Skip to content

Commit

Permalink
Merge #37986
Browse files Browse the repository at this point in the history
37986: storage: avoid deadlock on (*Stopper).Quiesce r=nvanbenschoten a=tbg

See
#37954 (comment).

Closes #37954.

Release note: None

Co-authored-by: Tobias Schottdorf <[email protected]>
  • Loading branch information
craig[bot] and tbg committed Jun 4, 2019
2 parents 55c049b + a0d0daf commit 6621937
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/storage/closedts/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ func (p *Provider) Subscribe(ctx context.Context, ch chan<- ctpb.Entry) {
for _, entry := range entries {
select {
case ch <- entry:
case <-p.cfg.Stopper.ShouldQuiesce():
return
case <-ctx.Done():
return
}
Expand Down Expand Up @@ -324,6 +326,8 @@ func (p *Provider) Subscribe(ctx context.Context, ch chan<- ctpb.Entry) {

select {
case ch <- entry:
case <-p.cfg.Stopper.ShouldQuiesce():
return
case <-ctx.Done():
return
}
Expand Down

0 comments on commit 6621937

Please sign in to comment.