-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add shutdown. #111
Add shutdown. #111
Conversation
753a325
to
35a62fd
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #111 +/- ##
==========================================
- Coverage 81.43% 81.35% -0.09%
==========================================
Files 10 10
Lines 1939 1952 +13
==========================================
+ Hits 1579 1588 +9
- Misses 360 364 +4
Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The high-level design here looks good, so assuming this works as expected, +1. Thanks!
This does not appear to impact how Bedrock behaves when it receives a |
The signal handler calls Also there's still the open naming question in the PR description if anyone has thoughts. |
c117058
to
38c825c
Compare
@mattcollier, I'd like to merge this (and do a minor release). Can you take a look at @davidlehn's comments and figure out if we need to make any changes to enable this to happen or if it's good to go? |
@mattcollier @davidlehn This PR keeps not landing -- we should try to push it forward so it doesn't hang out here any longer. |
The `shutdown()` call performs an orderly shutdown and emits events. This differs from the current `exit()` and `process.exit()` behavior which is more immediate.
38c825c
to
26d6943
Compare
@davidlehn can you do a quick audit to look for |
|
A
shutdown()
API is added to perform orderly shutdown. This came about due to howbedrock-test
was exiting. In the flow it uses, callingbedrock.exit()
orprocess.exit()
after successful testing results in a more abrupt shutdown. There isn't a way to exit and emit orderly events on the way. In some testing cases you may wantbedrock.exit
or similar events to trigger to do cleanup.This patch attempts to keep the same semantics for current code and only adds the
shutdown()
call (and does some refactoring). Retaining all prior behavior in all cases isn't well tested. Help wanted.shutdown()
could be named something else or be hacked intoexit()
as options, but this seemed like a simple approach. At the time this was written, it wasn't namedstop()
, but now I can't recall the reasoning and that might be a better choice as it aligns with start/stop semantics and event naming. Comments welcome.