Follow-up to #3753 and to JasperFx/jasperfx#598 (move the blue/green side-effect gate warm-up out of the agent start path).
Why
Every issue in the #3753 chain — #3748, #3749, #3750, JasperFx/jasperfx#594 and now JasperFx/jasperfx#598 — takes a slow agent start as its precondition. #3748 and #3750 genuinely require one; #3749's phantom stops look structural but are amplified by one.
Right now nothing in that chain reproduces at dev scale. The only verification site is the reporting customer's restored-production canary (512 tenant databases, ~6,500 agents, 5 nodes), which means:
- every candidate fix has to be shipped as a pinned prerelease and measured by someone else, on their schedule;
- we cannot write a regression test for any of the three defects already closed, so nothing stops them coming back;
- the emergent behaviour that actually bites — the observed peak of 60 concurrent warm-ups, the total assigned-agent count going down over a four-minute window — is invisible to
dotnet test.
FakeAgent.StartAsync currently returns Task.CompletedTask. That is precisely the assumption the whole chain violates.
What to build
A test seam that makes agent start cost configurable, then a distribution test at a scale that matters:
src/Testing/CoreTests/Runtime/Agents/scale_safe_batch_starts.cs is the closest existing precedent and probably where this lands.
Assertions worth having
Caveat, stated up front
A simulation is not a substitute for the canary. The pathologies in #3753 are emergent from real database contention, real node-table timing and real chunk sizes, and a fake-agent harness will reproduce the shape of the problem, not its magnitude. Sign-off on "a deploy carrying a projection version bump converges quickly on its own" almost certainly still needs the reporting customer's cluster, and they have offered to run diagnostics against a pinned prerelease.
The value here is the other direction: a dev-scale reproduction lets us iterate and reject bad fixes in minutes instead of round-tripping every candidate through someone else's production restore, and it gives the three closed defects regression coverage they do not currently have.
🤖 Generated with Claude Code
Follow-up to #3753 and to JasperFx/jasperfx#598 (move the blue/green side-effect gate warm-up out of the agent start path).
Why
Every issue in the #3753 chain — #3748, #3749, #3750, JasperFx/jasperfx#594 and now JasperFx/jasperfx#598 — takes a slow agent start as its precondition. #3748 and #3750 genuinely require one; #3749's phantom stops look structural but are amplified by one.
Right now nothing in that chain reproduces at dev scale. The only verification site is the reporting customer's restored-production canary (512 tenant databases, ~6,500 agents, 5 nodes), which means:
dotnet test.FakeAgent.StartAsynccurrently returnsTask.CompletedTask. That is precisely the assumption the whole chain violates.What to build
A test seam that makes agent start cost configurable, then a distribution test at a scale that matters:
FakeAgent: a settable start/stop delay (and ideally a per-agent one, so a tail can be simulated rather than a uniform cost — the field data is p50 27 s / p95 82 s / tail 215 s, and it is the tail that breaks things).FakeAgentFamily: an agent count parameter.Namesis a hardcoded 12; Node assignment is very slow, or never completes, when a release contains a projection version bump #3753 is about ~6,500.src/Testing/CoreTests/Runtime/Agents/scale_safe_batch_starts.csis the closest existing precedent and probably where this lands.Assertions worth having
AssignAgentschunk is not treated as complete (regression guard for A partially-fulfilled AssignAgents chunk is treated as complete, so agents still starting get re-placed onto other nodes #3750).Caveat, stated up front
A simulation is not a substitute for the canary. The pathologies in #3753 are emergent from real database contention, real node-table timing and real chunk sizes, and a fake-agent harness will reproduce the shape of the problem, not its magnitude. Sign-off on "a deploy carrying a projection version bump converges quickly on its own" almost certainly still needs the reporting customer's cluster, and they have offered to run diagnostics against a pinned prerelease.
The value here is the other direction: a dev-scale reproduction lets us iterate and reject bad fixes in minutes instead of round-tripping every candidate through someone else's production restore, and it gives the three closed defects regression coverage they do not currently have.
🤖 Generated with Claude Code