Skip to content
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

shutdown() should cancel the signal handlers installed by start() #120

Merged
merged 2 commits into from
May 21, 2022

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented May 17, 2022

motivation: allow easier testing of shutdown hooks

changes:

  • introduce ServiceLifecycle.removeTrap which removes a trap
  • call ServiceLifecycle.removeTrap when setting up the shutdown hook
  • make the shutdown hook cleanup into a lifecycle task to ensure correct ordering
  • add tests
  • improve logging

rdar://89552798

@tomerd tomerd requested review from yim-lee and ktoso May 17, 2022 01:56
@tomerd
Copy link
Contributor Author

tomerd commented May 17, 2022

@oc243 ptal if this is what you needed

motivation: allow easier testing of shutdown hooks

changes:
* introduce ServiceLifecycle.removeTrap which removes a trap
* call ServiceLifecycle.removeTrap when setting up the shutdown hook
* make the shutdown hook cleanup into a lifecycle task to ensure correct ordering
* add tests
* improve logging

rdar://89552798
Co-authored-by: Yim Lee <yim_lee@apple.com>
@tomerd tomerd merged commit 2133bfa into swift-server:main May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants