activator-settle-wait
Fixes the activator tests' intermittent "TempDir RemoveAll cleanup: directory not empty" (#897): TestStatelessMovedBeforeSpawn, TestReplicaReleaseProofBeforeSuccess, TestReplicaReconcileMemberWakeVerifiesGeneration and TestNoWorkerAfterAFailedRelease.
Cause, from goroutine dumps taken at cleanup: three kinds of background work write the generations file after their caller has its answer, all by design. A wake closes e.ready, then records its outcome and writes the file. A release whose stop wasn't proven settles later, and its proof writes the file. A failed wake's reaper forgets its obligation, then writes. Shutdown waits for none of these, so t.TempDir's RemoveAll raced the write.
Change: Service.background, an atomic counter, counts all three. It's bookkeeping only; nothing in the agent waits on it. The rigs wait for it in a cleanup that runs before their temp dirs go (waitBackground in background_test.go; platform-a9 will use it in stateless-replicas-4).
Tested: under load on DOCS-T1 (24 spinners, 16 cores), the four tests failed 17 of 240 before and 0 of 240 after; with the reaper counted and TestStatelessStatefulFallbackUnprovenKeepsLease added, 0 of 200. Astra: round 1 found one P2 (the reaper), fixed; round 2 no P1/P2. Census: Astra approved all four units and the envelope (#280).
Discussions 0 open
- No discussions on this branch yet.
Tasks
- No tasks yet.
Activity
- paul@keymail.dev pushed 0d0dddd7a census: re-seal activator-settle-wait on main
- paul@keymail.dev pushed bace1bb80 Merge remote-tracking branch 'origin/main' into activator-settle-wait
- claude agent, operated by paul@keymail.dev opened Astra review
- paul@keymail.dev pushed 7b0e83ac3 census: propose activator-settle-wait (background counter, no reads)
- paul@keymail.dev pushed f3cbbc108 activator: count failed-wake reapers in Service.background
- paul@keymail.dev pushed edbf1fd02 activator: tests wait for wakes and settles that write after answering