Skip to content

De-flake ClusterShardingSpec recovery phase: keep barriers out of Within - #8406

Merged
Aaronontheweb merged 4 commits into
devfrom
fix/sharding-recovery-phase-budget
Jul 18, 2026
Merged

Aaronontheweb merged 4 commits into
devfrom
fix/sharding-recovery-phase-budget

Conversation

@Aaronontheweb

@Aaronontheweb Aaronontheweb commented Jul 18, 2026 •

Copy link
Copy Markdown
Member

In the recover-entities-upon-restart phase, one WithinAsync(50s) spanned five barriers and the final Get(1) expect was unbounded, so it inherited the phase's remaining budget. A slow remember-entities recovery stalled that expect for most of the 50s, and EnterBarrier then derived its timeout from the Within remainder — clamped to zero — failing after-12 instantly on every node of a healthy cluster (build 129150, Linux MNTR, DData entity-recovery variant). Pekko's identical structure survives only because JVM within() dilates by timefactor; Akka.NET's Within does not.

This bounds the recovery check in a retrying probe-per-attempt AwaitAssert, gives every wait in the phase its own explicit bound, and removes the phase's outer Within entirely — all five barriers now run outside any Within so each rendezvous gets the full testconductor barrier-timeout instead of a starved remainder.

One WithinAsync(50s) spanned five barriers plus an unbounded ExpectMsgAsync, so a slow remember-entities recovery drained the shared budget and the final barrier's timeout clamped to zero. Bound the recovery check in a retrying probe-per-attempt AwaitAssert and move the barriers outside the Within so each gets the full barrier-timeout.
The remaining Within(50s) still wrapped three barriers and bounded steps whose worst cases sum past it. Every wait now carries its own explicit bound; all five barriers run outside any Within.

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LGTM- makes sense to keep the barriers out of the long-running cluster sharding operations

@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) July 18, 2026 13:05
@Aaronontheweb
Aaronontheweb merged commit f13a8fa into dev Jul 18, 2026
11 checks passed
@Aaronontheweb
Aaronontheweb deleted the fix/sharding-recovery-phase-budget branch July 18, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant