Skip to content

Commit

Permalink
storage: avoid deadlock on (*Stopper).Quiesce
Browse files Browse the repository at this point in the history
See
#37954 (comment).

Closes #37954.

Release note: None
  • Loading branch information
tbg committed Jun 4, 2019
1 parent 2428567 commit a0d0daf
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 a0d0daf

Please sign in to comment.