Skip to content
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

Convert SWIMActorShell to distributed actor #977

Merged
merged 28 commits into from
Aug 3, 2022
Merged

Conversation

yim-lee
Copy link
Member

@yim-lee yim-lee commented Jun 18, 2022

Resolves #973

⚠️ Haven't worked on tests yet ⚠️

Sources/DistributedActors/Cluster/ClusterShell.swift Outdated Show resolved Hide resolved
Sources/DistributedActors/Cluster/SWIM/SWIM+Messages.swift Outdated Show resolved Hide resolved
do {
let response = try await target.ping(payload: payload, from: self, timeout: timeout, sequenceNumber: sequenceNumber)
self.metrics.shell.pingResponseTime.recordInterval(since: pingSentAt)
return self.handlePingResponse(
Copy link
Member Author

Choose a reason for hiding this comment

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

The ActorRef implementation relies on multiple layers of ask and tell to get PingResponse back to the origin. The key difference in the DA implementation is that we eliminate the "hops", and the response returned by sendPing is the one we propagate back to origin.

Copy link
Member

Choose a reason for hiding this comment

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

That's very cool actually, great example how request/response focused API of DA makes such patterns simpler :)

@yim-lee yim-lee requested a review from ktoso June 18, 2022 01:04
@yim-lee yim-lee marked this pull request as draft June 18, 2022 01:15
@ktoso
Copy link
Member

ktoso commented Jun 21, 2022

Hmmm async await makes things quite tough here :-
Thank you for working on this, it really helps!

@yim-lee
Copy link
Member Author

yim-lee commented Jun 24, 2022

Changed Samples to use Swift 5.7 instead of main.

@swift-server-bot test this please

@yim-lee yim-lee changed the title [WIP] Convert SWIMActorShell to distributed actor Convert SWIMActorShell to distributed actor Jun 25, 2022
@yim-lee yim-lee marked this pull request as ready for review June 25, 2022 06:28
@yim-lee
Copy link
Member Author

yim-lee commented Jun 25, 2022

This PR is ready for review. Note that besides SWIMActorShell, there are major changes in the SWIM tests too.

@ktoso
Copy link
Member

ktoso commented Jul 29, 2022

Wohoo! Going to have a look.

@ktoso
Copy link
Member

ktoso commented Aug 3, 2022

Validate against main swift-cluster-membership now

@ktoso
Copy link
Member

ktoso commented Aug 3, 2022

Okey let's keep progressing;

I'll focus on tests and hardening for a while now.

@ktoso ktoso merged commit ec72733 into apple:main Aug 3, 2022
@yim-lee yim-lee deleted the iss973 branch August 4, 2022 05:58
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.

Convert SWIMActorShell into distributed actor
2 participants