Skip to content

Commit

Permalink
Handle in-progress events without deadlocking (#63)
Browse files Browse the repository at this point in the history
When in-progress messages are sent to the eventStream channel,
lifecycle-manager deadlocks, since there are no eventStream receivers
running in a separate goroutine. Instead of sending the in-progress
messages to the eventStream channel, we can process them immediately as
we process SQS-driven events, avoiding the deadlock.

Resolves #62
  • Loading branch information
JacobHenner authored Sep 10, 2020
1 parent a5630e3 commit 8fb4633
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/service/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ func (mgr *Manager) Start() {
if err != nil {
log.Errorf("failed to resume in progress events: %v", err)
}
mgr.eventStream <- message

event, err := mgr.newEvent(message, queueURL)
if err != nil {
mgr.RejectEvent(err, event)
continue
}

go mgr.Process(event)
}

// start SQS poller to load messages to stream from SQS
Expand Down

0 comments on commit 8fb4633

Please sign in to comment.