-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sequencer-relayer): provide a shutdown controller (#889)
## Summary Adds a shutdown handle for the sequencer-relayer. ## Background We want the ability to invoke the shutdown sequence from `main` and from tests. ## Changes A new RAII object `ShutdownHandle` has been added. This cancels the wrapped `CancellationToken` when the `ShutdownHandle` is dropped or when its `shutdown` method is called. `SIGTERM` handling has been moved to main.rs; on receiving a `SIGTERM`, `shutdown` is called on the shutdown handle associated with the relayer. The relayer's main `select!` loop was simplified to only contain the two tasks. ## Testing The `TestSequencerRelayer` was updated to make use of the new shutdown controller. Also manually tested by sending a `SIGTERM` to a running sequencer-relayer. ## Related Issues Closes #882
- Loading branch information
Showing
6 changed files
with
133 additions
and
46 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
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