File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,10 +234,16 @@ func (mgtr *Migrator) retryOperationWithExponentialBackoff(operation func() erro
234234// consumeRowCopyComplete blocks on the rowCopyComplete channel once, and then
235235// consumes and drops any further incoming events that may be left hanging.
236236func (mgtr * Migrator ) consumeRowCopyComplete () {
237- if err := <- mgtr .rowCopyComplete ; err != nil {
238- // Abort synchronously to ensure checkAbort() sees the error immediately
239- mgtr .abort (err )
240- // Don't mark row copy as complete if there was an error
237+ select {
238+ case err := <- mgtr .rowCopyComplete :
239+ if err != nil {
240+ // Abort synchronously to ensure checkAbort() sees the error immediately
241+ mgtr .abort (err )
242+ // Don't mark row copy as complete if there was an error
243+ return
244+ }
245+ case <- mgtr .migrationContext .GetContext ().Done ():
246+ // Abort cancelled the context
241247 return
242248 }
243249 atomic .StoreInt64 (& mgtr .rowCopyCompleteFlag , 1 )
You can’t perform that action at this time.
0 commit comments