SERVER-138492ClosedWorks as Designed

BackfillCoordinator sleepFor onError cancels the current State instead of its own

h2. Problem The {{sleepFor}} {{.onError}} lambda in {{BackfillCoordinator::markForBackfillAndScheduleIfNeeded()}} calls {{cancel()}} unconditionally. {{cancel()}} consumes whichever {{State}} is current, not the one the sleep was scheduled for. When a State's cancellation token is cancelled (for example by {{cancel()}} in the {{catch}} block of the same function), the cancelled sleep's {{onError}} runs later on an executor thread. By then a newer State is installed, so the stale callback: * dro

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix

No fix available yet.

Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.