Skip to content

Distributed singleton should be more careful with handover #1127

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 3, 2023

Conversation

ktoso
Copy link
Member

@ktoso ktoso commented Jul 3, 2023

Don't review yet;

Resolves #1123 by hardedning how the redirecring is done. This is still not optimal but hit IRGen issue

@ktoso ktoso force-pushed the wip-distributed-singleton-ensure-active branch from 7af996b to c60fc7d Compare July 3, 2023 07:26
}
} catch {
throw error
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This do/catch is just here so we can add debug logging, will do shortly

capInterval: settings.locateActiveSingletonBackoff.capInterval,
randomFactor: settings.locateActiveSingletonBackoff.randomFactor,
maxAttempts: settings.locateActiveSingletonBackoff.maxAttempts
).attempt {
Copy link
Member Author

Choose a reason for hiding this comment

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

Backoff.exponential().attemtpt {} is very nice, we're finally beginning to reap benefits of async/await inside the cluster :)

@ktoso
Copy link
Member Author

ktoso commented Jul 3, 2023

Once again a different flaky one: #1124
And #1128 -- this seems new but also only in one of the runs, so adding to the flaky list to investigate

This PR is to resolve a different flaky issue so I'll merge

@ktoso
Copy link
Member Author

ktoso commented Jul 3, 2023

Minor follow up ticket #1129

@ktoso
Copy link
Member Author

ktoso commented Jul 3, 2023

I'll merge so we have less flaky tests but please do review when you're back from break @yim-lee !

@ktoso ktoso merged commit 70f4191 into apple:main Jul 3, 2023
@ktoso ktoso requested a review from yim-lee July 3, 2023 07:54
@ktoso ktoso deleted the wip-distributed-singleton-ensure-active branch July 3, 2023 07:55
var backoff = self
var lastError: Error?
defer {
pprint("RETURNING NOW singleton")
Copy link
Member

Choose a reason for hiding this comment

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

Not intended to keep here I think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks!

case .none:
self.updateSingleton(nil)
}
}

// FIXME: would like to return `Act?` but can't via the generic combining with Codable: rdar://111664985 & https://github.com/apple/swift/issues/67090
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Solution incoming here: swiftlang/swift#67117

@@ -267,8 +310,8 @@ internal distributed actor ClusterSingletonBoss<Act: ClusterSingleton>: ClusterS
try await singletonFactory(self.actorSystem)
}

await singleton.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in
Copy link
Member

Choose a reason for hiding this comment

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

❤️

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.

FAILED: ClusterSingletonPluginClusteredTests.test_singletonByClusterLeadership_withLeaderChange
2 participants