Skip to content

[Distributed] Handle composite type in generic bound in distributed accessor #67117

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
**Review @xedin @drexin
Testing: CI testing
Radar: rdar://111664985
Resolves: #67090

@ktoso ktoso requested a review from xedin July 5, 2023 01:50
@ktoso
Copy link
Contributor Author

ktoso commented Jul 5, 2023

@swift-ci please test

@@ -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.

Copy link
Contributor

@drexin drexin left a comment

Choose a reason for hiding this comment

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

LGTM

@ktoso
Copy link
Contributor Author

ktoso commented Jul 5, 2023

Thanks for the hint and review folks

@ktoso ktoso merged commit e12d53e into swiftlang:main Jul 5, 2023
@ktoso ktoso deleted the wip-distributed-generic-fail branch July 5, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed Feature → concurrency: distributed actor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Distributed] IRGenRequest crash when "Codable & SomeDistActorProtocol" are used and returned from dist runc
3 participants