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

cancelOnGracefulShutdown hangs, if cancellation is not immediately #177

Conversation

fabianfett
Copy link
Member

Motivation

Currently cancelOnGracefulShutdown hangs forever, if cancellation is not immediately but returns a eventually successful result (test case 1: testCancelOnGracefulShutdownSurvivesCancellation).
If the Cancellation leads to another error than CancellationError, this error is currently not propagated to the user (test case 2: testCancelOnGracefulShutdownSurvivesErrorThrown).

Changes

  • AsyncGracefulShutdownSequence should never throw as this hides the real errors otherwise
  • CancellationWaiter should never throw as this hides the real errors otherwise
  • Adjustments in cancelOnGracefulShutdown

Result

  • cancelOnGracefulShutdown works as expected

@fabianfett fabianfett requested review from FranzBusch and adam-fowler and removed request for adam-fowler February 21, 2024 20:32
Copy link
Contributor

@FranzBusch FranzBusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! Thanks for doing the work.

@FranzBusch FranzBusch merged commit d7fe0e7 into swift-server:main Feb 22, 2024
6 checks passed
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