Keep an OOM verdict for a corpse first seen past its deadline - #2065
Merged
Merged
Conversation
The observe loop read the wall clock before asking whether the supervisor was still there, so a run whose supervisor was already gone and whose deadline had already passed was stopped as TimedOut on the clock alone. That corpse never reached VanishedAsync, which classifies one by its exit marker, then a controller's deadline stop record, then the cgroup OOM counter, and only turns a plain Failed into TimedOut. An OOM-killed run first observed after its deadline (a re-attach after an outage, a slow worker) therefore read TimedOut instead of ResourceExhausted, and was retried under the same memory ceiling. The clock now stops a run by itself only while the supervisor is not provably gone: still running, or a pid this worker cannot resolve (a handle another host minted), which IsSupervisorGone already answers false for. A supervisor that is gone falls through to VanishedAsync, which already applies the clock to a plain failure. The deadline stop record and the exit marker are still read first, unchanged. The tests drive the observe loop itself instead of handing VanishedAsync the corpse: an OOM-killed supervisor past its deadline is ResourceExhausted, the same corpse without an OOM count is TimedOut, and a live supervisor past its deadline is still timed out and killed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TimedOuton the clock alone. That corpse never reachedVanishedAsync, which classifies one by its exit marker, then a controller's deadline stop record, then the cgroup OOM counter, and only turns a plainFailedintoTimedOut. An OOM-killed run first observed after its deadline (a re-attach after an outage, a slow worker) readTimedOutinstead ofResourceExhaustedand was retried under the same memory ceiling.!IsSupervisorGone(handle): still running, or a pid this worker cannot resolve, whichIsSupervisorGonealready answers false for). A supervisor that is gone falls through to the existingVanishedAsynccall, which already applies the clock to a plain failure. The deadline stop record and the exit marker are still read first, unchanged.Test plan
LocalProcessDurableRunnerTests154 -> 157, all green. Three new tests drive the observe loop throughAttachAsyncinstead of handingVanishedAsyncthe corpse: an OOM-killed supervisor past its deadline isResourceExhausted; the same corpse without an OOM count isTimedOut; a live supervisor past its deadline is stillTimedOutand killed (its launch deadline is 120 s away, beyond the test's 60 s bound, so only the observer's clock can settle it).TimedOutand the other two passed.&& IsSupervisorGone(handle)) turns the OOM row and the live-supervisor test red. Each mutation was restored by copy and verified withcmpandgit diff.LocalProcessDurableRunnerTestsclass, 157/157.NativeLaunchRegistryTests91/91 (including theNativeTerminateOutcomeTests.cspartial),LocalProcessLaunchDiscoveryCounterexampleTests3/3,CgroupResourceLimitTests6/6.