Skip to content

🍒[5.9][Distributed] Handle composite type in generic bound in distributed accessor #67118

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 2 commits into from
Jul 5, 2023

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Jul 5, 2023

Description: It seems a distributed accessor's emit fails for DistributedActor & Somethign, the crash is in IGM.getTypeInfo(directResultTy); because the method does not have access to a generic context; The solution is to provide it earlier during emit rather than later as we did before.
See Also: Resolves a FIXME in distributed cluster: https://github.com/apple/swift-distributed-actors/pull/1127/files#diff-7da4ba0dfda5902083a859fdf6d209fb5902d4926b6bee24fa7eee420b84b4e3R231
Risk: Low, only moves the generic scope a few lines earlier, since we use it there already
Reviewed by: @xedin @drexin (original PR)
Original PR: #67117
Testing: CI testing
Radar: rdar://111664985
Resolves: #67090

@ktoso ktoso requested a review from a team as a code owner July 5, 2023 01:52
@ktoso ktoso added distributed Feature → concurrency: distributed actor 🍒 release cherry pick Flag: Release branch cherry picks swift 5.9 labels Jul 5, 2023
@@ -616,6 +616,8 @@ void DistributedAccessor::emit() {

auto params = IGF.collectParameters();

GenericContextScope scope(IGM, targetTy->getInvocationGenericSignature());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix™ is that this must be made before the IGM getTypeInfo call, otherwise the generic context is not available (null) and we crash.

@ktoso
Copy link
Contributor Author

ktoso commented Jul 5, 2023

@swift-ci please test

@ktoso ktoso merged commit e741091 into swiftlang:release/5.9 Jul 5, 2023
@ktoso ktoso deleted the pick-distributed-generic-fail branch July 5, 2023 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed Feature → concurrency: distributed actor 🍒 release cherry pick Flag: Release branch cherry picks swift 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants