Skip to content

Commit

Permalink
mvcc: fix deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
tangcong committed Apr 26, 2020
1 parent 0461b3f commit 784d04a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mvcc/kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ func NewStore(lg *zap.Logger, b backend.Backend, le lease.Lessor, ci cindex.Cons

func (s *store) compactBarrier(ctx context.Context, ch chan struct{}) {
if ctx == nil || ctx.Err() != nil {
s.mu.Lock()
select {
case <-s.stopc:
default:
s.mu.Lock()
f := func(ctx context.Context) { s.compactBarrier(ctx, ch) }
s.fifoSched.Schedule(f)
s.mu.Unlock()
}
s.mu.Unlock()
return
}
close(ch)
Expand Down

0 comments on commit 784d04a

Please sign in to comment.