fix(cluster.tools): fix race condition in DistributedPubSubRestartSpec actor creation#7980
Merged
Aaronontheweb merged 3 commits intoDec 23, 2025
Conversation
…c actor creation Move shutdown actor creation to execute immediately after the new ActorSystem joins, before the 5-second gossip isolation verification. This eliminates the race where First node times out waiting for Third node to create the shutdown actor. Changes: - Create shutdown actor before ExpectNoMsgAsync delay on Third node - Migrate sync-over-async methods to proper async (ExpectMsgAsync, RunOnAsync) - Increase timeout margins (WithinAsync 20s→25s, ExpectMsgAsync 1s→2s) for better CI stability
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
- Use dedicated TestProbe for Identify messages in AwaitAssertAsync to avoid polluting TestActor mailbox with stray ActorIdentity responses from retry attempts - Use dedicated TestProbes for DeltaCount queries on First and Second nodes with explicit 5-second timeouts - This prevents message queue pollution from causing timeout failures when ExpectMsgAsync<long> was receiving messages meant for TestActor
Arkatufus
pushed a commit
to Arkatufus/akka.net
that referenced
this pull request
Jan 7, 2026
…c actor creation (akkadotnet#7980) Move shutdown actor creation to execute immediately after the new ActorSystem joins, before the 5-second gossip isolation verification. This eliminates the race where First node times out waiting for Third node to create the shutdown actor. Changes: - Create shutdown actor before ExpectNoMsgAsync delay on Third node - Migrate sync-over-async methods to proper async (ExpectMsgAsync, RunOnAsync) - Increase timeout margins (WithinAsync 20s→25s, ExpectMsgAsync 1s→2s) for better CI stability
Aaronontheweb
added a commit
that referenced
this pull request
Jan 8, 2026
…c actor creation (#7980) Move shutdown actor creation to execute immediately after the new ActorSystem joins, before the 5-second gossip isolation verification. This eliminates the race where First node times out waiting for Third node to create the shutdown actor. Changes: - Create shutdown actor before ExpectNoMsgAsync delay on Third node - Migrate sync-over-async methods to proper async (ExpectMsgAsync, RunOnAsync) - Increase timeout margins (WithinAsync 20s→25s, ExpectMsgAsync 1s→2s) for better CI stability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root Cause
The test was flaky because the Third node created the
shutdownactor after a 5-secondExpectNoMsgAsyncdelay, but the First node started polling for it immediately afterTestConductor.Shutdown. On slow CI machines, the 20-second timeout would expire before the actor was created.Changes
JoinAsync, before the gossip verificationExpectMsg<T>()→ExpectMsgAsync<T>(),RunOn()→RunOnAsync()WithinAsyncfrom 20s→25s and innerExpectMsgAsyncfrom 1s→2sTest plan
DistributedPubSubRestartSpecno longer flaky under load