-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shutdown: Don't stop receiver, deprecate ShutdownTimeout (#1082)
Stacked on top of: - #1081 However, since I can't push branches directly to this repository, this PR shows commits from both PRs. --- Shutdowner.Shutdown is not a blocking operation. It does not need to block and wait for the relay goroutine to stop; signalReceiver.Stop will do that. To clarify this further, signalReceivers has the following operations: - Start: starts a relay goroutine - Stop: stops the relay goroutine and waits for it - Wait: create and return a `chan ShutdownSignal` - Done: create and return a `chan os.Signal` - Broadcast: Send the message to all waiting channels The only reason that the relay goroutine exists is to map `os.Signal`s received by `os/signal.Notify` into an `fx.ShutdownSignal`. Shutdowner.Shutdown should not call signalReceivers.Stop because the relay goroutine should keep running so that we can re-use Shutdowner.Shutdown. This change exposed a leak in TestDataRace (fixed in #1081). --------- Co-authored-by: Sung Yoon Whang <[email protected]>
- Loading branch information
Showing
3 changed files
with
9 additions
and
23 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
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
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