Skip to content

[Distributed] Handle #isolation param in DA as known to not cross isolation #75327

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

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Jul 18, 2024

The isolation checker was assuming that one can only be isolated to a specific var, but that's not true for distributed actors -- because the default parameter emitted by #isolation is a method call -- converting the self into an any Actor.

We must handle this in isolation checker in order to avoid thinking we're crossing isolation boundaries and making methods implicitly async etc, when we're actually not.

resolves rdar://131874709

@ktoso ktoso requested a review from DougGregor July 18, 2024 11:59
@@ -548,7 +548,7 @@ extension ActorAddress {
return bytes
}
func fromBytes(_ bytes: [UInt8]) throws -> ActorAddress {
let address = String(cString: bytes)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

killed off a new deprecation warning while at it

// as otherwise we don't know where the value came from and if it's really
// self we're calling from; We'd need more sophisticated analysis to make it work.
// let myself = self.asLocalActor
// pass(isolatedToActor: myself) // same
Copy link
Contributor Author

Choose a reason for hiding this comment

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

so we can't support this yet... which is fine; the primary usecase is #isolation's default value

@ktoso ktoso force-pushed the wip-self-isolation-passing-for-distributed branch from 7f7ca53 to bbf75d1 Compare July 18, 2024 12:07
@ktoso
Copy link
Contributor Author

ktoso commented Jul 18, 2024

@swift-ci please smoke test

@ktoso ktoso added distributed Feature → concurrency: distributed actor actor isolation Feature → concurrency: Actor isolation labels Jul 18, 2024
…lation

The isolation checker was assuming that one can only be isolated to a
specific var, but that's not true for distributed actors -- because the
default parameter emitted by #isolation is a method call -- converting
the self into an any Actor.

We must handle this in isolation checker in order to avoid thinking
we're crossing isolation boundaries and making methods implicitly async
etc, when we're actually not.

resolves rdar://131874709
@ktoso ktoso force-pushed the wip-self-isolation-passing-for-distributed branch from bbf75d1 to ddaba86 Compare July 18, 2024 13:30
@ktoso
Copy link
Contributor Author

ktoso commented Jul 18, 2024

@swift-ci please smoke test

@ktoso ktoso merged commit e53cd7d into swiftlang:main Jul 19, 2024
3 checks passed
@ktoso ktoso deleted the wip-self-isolation-passing-for-distributed branch July 19, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actor isolation Feature → concurrency: Actor isolation distributed Feature → concurrency: distributed actor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant