Skip to content

🌸[6.0][Concurrency] Remove _unsafeInheritExecutor from public APIs, use #isolation #72830

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

Merged
merged 4 commits into from
Apr 8, 2024

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Apr 4, 2024

Description: In order to avoid isolation boundary warnings when task groups are used inside (global) actors we need to inherit isolation contest to most of their async APIs. Specifically, this PR resolves next() and waitForAll() now inheriting caller isolation.

Without this fix, the added test case would have failed with:

Passing argument of non-sendable type 'inout ThrowingTaskGroup<Void, any Error>' outside of main actor-isolated context may introduce data races

Risk: Low, because all existing ABI entrypoints are retained.
Review by: @hborla
Testing: CI testing
Original PR: #72794 #72578 #72862
Radar: rdar://122846553Otherwise we get warnings when task groups are used within an actor.
Add global actor tests to cover the specific situation.

resolves rdar://122846553

@ktoso ktoso requested a review from a team as a code owner April 4, 2024 13:16
@ktoso ktoso requested a review from hborla April 4, 2024 13:16
@ktoso
Copy link
Contributor Author

ktoso commented Apr 4, 2024

@swift-ci please test

@ktoso ktoso added concurrency Feature: umbrella label for concurrency language features 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Apr 4, 2024
@ktoso
Copy link
Contributor Author

ktoso commented Apr 4, 2024

@swift-ci please test

1 similar comment
@ktoso
Copy link
Contributor Author

ktoso commented Apr 5, 2024

@swift-ci please test

@ktoso ktoso changed the title 🌸[6.0][Concurrency] waitForAll and next of TaskGroups must inherit isolation 🌸[6.0][Concurrency] Remove _unsafeInheritExecutor from public APIs, use #isolation Apr 5, 2024
ktoso added 3 commits April 5, 2024 16:00
Otherwise we get warnings when task groups are used within an actor.
Add global actor tests to cover the specific situation.

resolves rdar://122846553

futher ABI safeguarding
@ktoso ktoso force-pushed the pick-waitForAll-isolation branch from 5aec7cb to 3d372d3 Compare April 5, 2024 07:02
@hborla
Copy link
Member

hborla commented Apr 5, 2024

@swift-ci please test

@hborla hborla merged commit 9c4adb7 into swiftlang:release/6.0 Apr 8, 2024
@ktoso ktoso deleted the pick-waitForAll-isolation branch May 22, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concurrency Feature: umbrella label for concurrency language features 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants