swift-server / swift-service-lifecycle

Cleanly startup and shutdown server application, freeing resources in order before exiting.
https://swiftpackageindex.com/swift-server/swift-service-lifecycle/documentation/servicelifecycle
Apache License 2.0
396 stars 38 forks source link

`cancelOnGracefulShutdown` hangs, if cancellation is not immediately #177

Closed fabianfett closed 8 months ago

fabianfett commented 8 months ago

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

Result