Skip to content

Commit

Permalink
handle migration error case
Browse files Browse the repository at this point in the history
  • Loading branch information
kutluhanmetin committed Sep 4, 2023
1 parent aa90444 commit 82be952
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions base/commands/migration/stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ func (st *Stages) waitForStatus(ctx context.Context, waitInterval time.Duration,
timeoutErr := fmt.Errorf("migration could not be completed: reached timeout while reading status: " +
"please ensure that you are using Hazelcast's migration cluster distribution and your DMT config points to that cluster")
for {
if err := ctx.Err(); err != nil && errors.Is(err, context.DeadlineExceeded) {
return timeoutErr
if err := ctx.Err(); err != nil {
if errors.Is(err, context.DeadlineExceeded) {
return timeoutErr
} else {
return fmt.Errorf("migration failed: %w", err)
}
}
s, err := st.readStatus(ctx)
if err != nil {
Expand Down

0 comments on commit 82be952

Please sign in to comment.