Skip to content

Commit 6fabaf8

Browse files
committed
backupccl: add missing ctx cancel check
In #111159 we deduced from the stacks a situation in which the goroutine draining `spanCh` had exited due to a context cancelation but the writer was not listening for a ctx cancelation. This manifests as a stuck restore when using the non-default make simple import spans implementation. Fixes: #111159 Release note: None
1 parent cb7c66f commit 6fabaf8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/ccl/backupccl/restore_span_covering.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,11 @@ func generateAndSendImportSpans(
519519
return err
520520
}
521521
for _, sp := range importSpans {
522-
spanCh <- sp
522+
select {
523+
case <-ctx.Done():
524+
return ctx.Err()
525+
case spanCh <- sp:
526+
}
523527
}
524528
return nil
525529
}

0 commit comments

Comments
 (0)