-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid potential hang when starting event listener
It was possible for NewEvents to never return, blocked on waiting for a WaitGroup to be done. The call to Done was in a goroutine that could exit before reaching the Done call. Replace the WaitGroup with a channel that is closed to signal that initialisation is complete. Also, while we are waiting on the channel, wait on the context so we can exit clealy if the context is canceled.
- Loading branch information
Showing
1 changed file
with
25 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters