-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Distributed] prevent remote distributed actor's from running deinit bodies #60050
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
Conversation
4182dd9
to
fbfe72f
Compare
auto managedSelf = ManagedValue::forBorrowedRValue(selfValue); | ||
|
||
auto selfTy = F.mapTypeIntoContext(cd->getDeclaredInterfaceType()); | ||
emitDistributedIfRemoteBranch( |
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.
For isolated deinit I need this check to live inside deallocating deinit. Because isolation happens in deallocating deinit, and remote proxies don't need isolation. I would really appreciate if you could place the check already in the deallocating deinit, so that I don't need to move it later.
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.
As I'd like to cherry-pick this over to 5.7 so it gets has a chance to get into the release still, and we're a bit limited in how big "risk" changes we can take there, I'd I'd like to keep this PR as minimal as possible and only focused on fixing the bug. We can refactor and change things around later though.
I'm happy to do that in a follow up PR later on 👍
fbfe72f
to
60c015d
Compare
60c015d
to
027c4a6
Compare
@swift-ci please smoke test |
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.
LGTM!
Co-authored-by: Kavon Farvardin <[email protected]>
@swift-ci please smoke test and merge |
@@ -554,20 +557,21 @@ SILGenFunction::emitConditionalResignIdentityCall(SILLocation loc, | |||
|
|||
void SILGenFunction::emitDistributedActorClassMemberDestruction( |
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.
emitDistributedActorClassMemberDestruction()
and emitConditionalResignIdentityCall()
seem to be dead
B.createBranch(SILLocation(Loc), finishBB); | ||
} | ||
} | ||
|
||
emitProfilerIncrement(dd->getTypecheckedBody()); |
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.
IIUC, this can be emitted into remoteBB
after branch instruction, creating incorrect SIL. Should it be after B.emitBlock(deinitBodyBB)
?
Would be nice to have a unit test for deinit and profiling.
Deinit bodies should not run for remote distributed actors since they have no state at all, and any such user defined deinit will be wrong.
Resolves: rdar://96980182
Reported in https://forums.swift.org/t/pitch-distributed-actor-runtime/54045/15