You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0
Calling cancelOnGracefulShutdown currently never finishes, because the withThrowingTaskGroup keeps running the "waiting-for-graceful-shutdown" task.
Afaik this is due to some unfortunate inconsistency with task groups with their "cancelAll on return" behavior. edit: this has nothing to do with environment or inconsistencies, was just a plain bug.
This test will never finish in my environment:
func testResumesCancelOnGracefulShutdownWithResult() async throws {
await testGracefulShutdown { _ in
let result = await cancelOnGracefulShutdown {
await Task.yield()
return "hello"
}
XCTAssertEqual(result, "hello")
}
}
Adding a "manual" group.cancelAll() should do the trick.
The text was updated successfully, but these errors were encountered:
sliemeobn
added a commit
to sliemeobn/swift-service-lifecycle
that referenced
this issue
May 7, 2023
Motivation:
+ cancelOnGracefulShutdown was getting stuck on macOS
Modifications:
+ added explicit group.cancelAll() to all execution paths
Co-authored-by: Simon Leeb <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
In version 2.0.0-alpha.1
Calling
cancelOnGracefulShutdown
currently never finishes, because thewithThrowingTaskGroup
keeps running the "waiting-for-graceful-shutdown" task.Afaik this is due to some unfortunate inconsistency with task groups with their "cancelAll on return" behavior.edit: this has nothing to do with environment or inconsistencies, was just a plain bug.
This test will never finish in my environment:
Adding a "manual"
group.cancelAll()
should do the trick.The text was updated successfully, but these errors were encountered: