Skip to content

Commit

Permalink
backupccl: add missing ctx cancel check
Browse files Browse the repository at this point in the history
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
  • Loading branch information
adityamaru committed Sep 25, 2023
1 parent cb7c66f commit 6fabaf8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/ccl/backupccl/restore_span_covering.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 6fabaf8

Please sign in to comment.