Skip to content

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Aug 29, 2025

Description: the new NonisolatedNonsendingByDefault upcoming feature breaks remote calls in distributed actors, because the expected isolation doesn't match and the runtime swift_distributed_execute_target_resume will crash.

Scope/Impact: Only impacts distributed thunks generated for distributed methods, such that the NonisolatedNonsendingByDefault does not affect them, as it would cause crashes in mismatch of runtime and generated funcs expectations.

Risk: Low, unbreaks mismatch in parameter alignment.

Testing: Added test which reproduces the issue
Reviewed by: @xedin

Original PR: #83940 #84072
Radar: rdar://159247975

…stributed thunks

the new NonisolatedNonsendingByDefault upcoming feature breaks remote
calls in distributed actors, because the expected isolation doesn't
match and the runtime swift_distributed_execute_target_resume will
crash.

This is a short term fix to unblock adopters, however preferably we
should mark the thunks as nonisolated(nonsending), though that seems to
be more involved.

resolves rdar://159247975
@ktoso ktoso requested a review from a team as a code owner August 29, 2025 07:43
@ktoso
Copy link
Contributor Author

ktoso commented Aug 29, 2025

@swift-ci please smoke test

@ktoso
Copy link
Contributor Author

ktoso commented Aug 29, 2025

@swift-ci please test

@ktoso ktoso marked this pull request as draft August 29, 2025 07:52
@ktoso ktoso changed the title [6.2] Pick nonisolatednonsending by default and distributed thunks [6.2] Fix nonisolatednonsending by default and distributed thunks Sep 2, 2025
@ktoso ktoso changed the title [6.2] Fix nonisolatednonsending by default and distributed thunks [6.2][Concurrency/Distributed] fix nonisolated-nonsending by default and distributed thunks Sep 2, 2025
Otherwise the "nonisolated nonsending by default" mode blows up as
distributed thunk signatures dont match expectations.

This undoes the fix from swiftlang#83940
and applies the fix on the synthesis side of the distributed thunks,
such that they are @Concurrent always -- which keeps their old semantics
basically, regardless of what "default" mode we have.
@ktoso ktoso marked this pull request as ready for review September 3, 2025 09:59
@ktoso ktoso changed the title [6.2][Concurrency/Distributed] fix nonisolated-nonsending by default and distributed thunks [6.2][Concurrency/Distributed] ensure distributed thunks are @concurrent Sep 3, 2025
@ktoso
Copy link
Contributor Author

ktoso commented Sep 3, 2025

@swift-ci please test

@ktoso
Copy link
Contributor Author

ktoso commented Sep 4, 2025

@swift-ci please test

@ktoso ktoso enabled auto-merge September 5, 2025 03:17
@ktoso ktoso merged commit 64e98e6 into swiftlang:release/6.2 Sep 5, 2025
5 checks passed
@ktoso ktoso deleted the pick-nonisolatednonsending-by-default-and-distributed branch September 8, 2025 03:26
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