diff --git a/pkg/ccl/backupccl/restore_span_covering.go b/pkg/ccl/backupccl/restore_span_covering.go index 6283e0589111..ba92f472b892 100644 --- a/pkg/ccl/backupccl/restore_span_covering.go +++ b/pkg/ccl/backupccl/restore_span_covering.go @@ -519,7 +519,11 @@ func generateAndSendImportSpans( return err } for _, sp := range importSpans { - spanCh <- sp + select { + case <-ctx.Done(): + return ctx.Err() + case spanCh <- sp: + } } return nil }