-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fixes cancelOnGracefulShutdown issue (#135) #136
Fixes cancelOnGracefulShutdown issue (#135) #136
Conversation
Motivation: + cancelOnGracefulShutdown was getting stuck on macOS Modifications: + added explicit group.cancelAll() to all execution paths
@swift-server-bot add to allowlist |
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.
Good catch. Thanks for fixing this!
@@ -80,12 +80,12 @@ public func cancelOnGracefulShutdown<T>(_ operation: @Sendable @escaping () asyn | |||
} | |||
|
|||
let result = try await group.next() | |||
group.cancelAll() // currently needed, as the group does not always auto-cancel tasks on return |
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.
Hmm the comment seems a bit off, this is not accidental the group just waits, there's no implicit cancel at end of it.
Code looks good, just rephrase the comment?
cc @FranzBusch
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.
oh my, totally my fault, thanks for addressing this! I was already feeling bad about spreading misinformation in the github issue.
I was confusing the cancelAll
behavior with this for whatever reason (pretty wild in hindsight how I could mix these up). ...oh the shame... ; )
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.
may I offer a PR for the fix:
#137
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.
Thanks for the fix!
Yeah I don't blame you, there's a lot of behavior to keep in your head smetimes with these... thanks!
fix for #135
Motivation:
Modifications: