Expand description
Exit reason hints for finished executions.
A numeric exit code alone is frequently misleading: a Bun/Node process that
exhausts its heap aborts itself, so the container reports exitCode 139
with OOMKilled false even though the run died of memory exhaustion (issue
#162, related to #144, #148 and #151). start already reads the tail of the
log to find the terminal footer, so the same tail is scanned for well-known
fatal markers and the finding is surfaced as an extra exitReason field.
The same scan answers a narrower question for consumers that key off
oomKilled: was this run killed by memory exhaustion at all? That answer is
surfaced as memoryExhausted plus memoryExhaustedReason, the log line that
carried the evidence (issue #165).
Both fields are hints, never verdicts: they never change status,
exitCode or oomKilled.
Structs§
- Exit
Code Description - A decoded exit code: the numeric value, the signal it encodes (if any), and
the human-readable rendering both the container post-mortem and
--statusprint. - Exit
Reason Marker - A fatal marker found in the log: its category and the line that carried it.
- Memory
Exhaustion - The memory-exhaustion observation derived from a log tail (issue #165).
Constants§
- CGROUP_
OOM_ EXIT_ REASON - Reason reported when the container-wide OOM observation explains the exit.
- SIGNAL_
NAMES - Exit codes above 128 encode the signal that killed the process. Only the signals that actually show up in command logs are named.
- UNKNOWN_
EXIT_ CODE - Text used wherever a fact could not be observed at all.
Functions§
- describe_
exit_ code - Decode an exit code once, for every caller (issue #171.4).
- describe_
exit_ code_ str - Decode an exit code that arrived as text (e.g. from the watcher’s shell).
- detect_
exit_ reason - Scan log text for a known fatal marker.
- detect_
memory_ marker - Scan log text for a marker that reports memory exhaustion specifically.
- find_
exit_ reason_ marker - Scan log text for the first accepted fatal marker, most specific first.
- is_
oom_ kill_ of_ command - Can a container-wide OOM observation be blamed on the command itself?
- resolve_
exit_ reason - Resolve the best available hint for why an execution ended.
- resolve_
memory_ exhaustion - Decide whether an execution died of memory exhaustion, and say why.
- signal_
name_ for_ exit_ code - Map a shell exit code to the signal name it encodes.