Runtime.Tests flake: GrpcDataLateWriteTests.Reserved_observer_records_actual_late_result_and_releases_owned_lifetime — observes lifetime before the slot release #964
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Seen 2026-12-01 in the #962 repro loop (full
FullyQualifiedName~DataConnections&Category!=SlowUnitfilter, 3 parallel lanes, host load ~60): 1 failure in the before-loop.Cause (read from the code, test-side timing):
LateWriteReservation.ObserveCore'sfinallyrunsclaim.PhysicalFinished(), thenlifetime?.Dispose(), then_owner.Release(this, _target). The test waitsWaitUntil(() => claim.CurrentOutcome == Success && lifetime.Count == 1)and then immediately callsobserver.TryReserve, so it can run between the lifetime dispose and the slot release. The production order (lifetime released before the physical slot) looks intentional; the test is waiting on the wrong signal.Fix suggestion: wait for the slot itself (e.g.
WaitUntil(() => observer.TryReserve(out var r) && Dispose(r)), or expose an outstanding count) instead of the lifetime counter. Same pattern may affectExpired_observer_retains_physical_capacity_and_lifetime_until_driver_really_finishesandAlready_completed_driver_is_observed_and_reservation_dispose_is_idempotent(both wait onlifetime.Count == 1thenTryReserve).Found while working #962; out of scope there.
Fixed in
bcd4a9aa2(merged7c4a070cc). Real production race: the write reply/WriteCompleted ran on a different continuation from LateWriteReservation's slot release, so the next same-tag write could be falsely rejected as capacity exhausted. Observe now returns a Task that RunRichWriteAsync awaits when the physical write completed. Actor repro failed 3/3 before and passes 15/15 under heavy load after; the unit loop went from 22–39 false rejections per 2M iterations to 0. Follow-up: #967.