carlos / platform Public

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).

Commits 5
Discussions 1 0 open
Tasks 0/0 done

Discussions 0 open

  • No discussions on this branch yet.

Tasks

  • No tasks yet.

Activity