Skip to main content

Module exit_reason

Module exit_reason 

Source
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§

ExitReasonMarker
A fatal marker found in the log: its category and the line that carried it.
MemoryExhaustion
The memory-exhaustion observation derived from a log tail (issue #165).

Functions§

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