Skip to content

Commit

Permalink
Merge pull request #164 from kaleido-io/fix-162
Browse files Browse the repository at this point in the history
Avoid holding batchCond while dispatching updateInterrupt
  • Loading branch information
peterbroadhurst authored Oct 11, 2021
2 parents e53ad60 + dfea76f commit e80c6b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/events/eventstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,11 @@ func (a *eventStream) batchProcessor() {
a.batchCond.L.Lock()
for !a.suspendOrStop() && a.batchQueue.Len() == 0 {
if a.updateInProgress {
a.batchCond.L.Unlock()
<-a.updateInterrupt
// we were notified by the caller about an ongoing update, return
log.Infof("%s: Notified of an ongoing stream update, exiting batch processor", a.spec.ID)
a.updateWG.Done() //Not moving this to a 'defer' since we need to unlock after calling Done()
a.batchCond.L.Unlock()
a.updateWG.Done()
return
} else {
a.batchCond.Wait()
Expand Down

0 comments on commit e80c6b7

Please sign in to comment.