Troubleshooting Production Outages (OOMKilled, Exit Codes 137, 143, 1)
Decode OOMKills and common exit codes to restore services quickly.
In plain words
Stabilize service and preserve evidence before experimenting, then prove the triggering condition and recovery.
Think of it like…
Incident triage is a flight recorder plus maintenance gauges: first contain the aircraft, then compare when the alarms fired and which part changed.
Where you’ve seen it
In practice, docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory" is the concrete move for this job: decode OOMKills and common exit codes to restore services quickly. The release is not accepted until collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain confirms the result.
Words you’ll hear
- OOMKilled
- The implementation control in
docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory"for decode OOMKills and common exit codes to restore services quickly. - 137
- The result to observe with
collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain, rather than infer from a successful command alone. - 143
- The production boundary exposed when restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence.
Visual diagram
Theory & deep dive
OOMKilled control path
The concrete mechanism is docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory". The observable result is collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain; if those disagree, inspect the runtime evidence before changing unrelated settings.
Decode OOMKills and common exit codes to restore services quickly. Keep OOMKilled, 137 and 143 in the same deployment record so the intent and the observed state cannot drift apart.
docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory"
collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain, not with command success alone.143 failure boundary
An exit code is not a root cause; 137 can come from manual kill and 143 can be a forced timeout. Restart loops overwrite useful timeline signals, and pulling latest during an incident adds another variable. The narrow failure to design for is restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence.
Accept this compromise explicitly: A measured rollback is fast containment; fixing capacity requires load tests and trend data so the incident does not recur. The controlled check-collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain-also identifies the point where a different design is safer.
Exercise this failure safely: restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence.
How it works, step by step
Step 1 of 41. State the boundary
Write down why the workload needs this: An exit code is not a root cause; 137 can come from manual kill and 143 can be a forced timeout. Restart loops overwrite useful timeline signals, and pulling latest during an incident adds another variable.
- Intent
- OOMKilled
When to use it & trade-offs
What it is
Start an outage with scope and last-known state, then inspect container status, State.OOMKilled, exit code, logs, events, host disk/memory and deploy/image digest. Exit 137 means SIGKILL (often OOM), 143 means SIGTERM (often shutdown) and 1 is a generic app failure.
Why it matters: An exit code is not a root cause; 137 can come from manual kill and 143 can be a forced timeout. Restart loops overwrite useful timeline signals, and pulling latest during an incident adds another variable.
When to reach for it
- The fit is strongest for this job: decode OOMKills and common exit codes to restore services quickly. Pair it with
collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drainin the runbook. - Production OOMKilled changes should make 137 observable through
docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory", rather than trusting the runtime default. - Keep a rollback example for the case where restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence.
When to avoid or be careful
- Do not accept command success while the system can still fail by restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence.
- Avoid erasing 143 protection merely to dodge this cost: “A measured rollback is fast containment; fixing capacity requires load tests and trend data so the incident does not recur”.
- Do not replace the evidence path-
collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain-with a screenshot or a mutable tag.
docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory": practical choices
Strengths: Start an outage with scope and last-known state, then inspect container status, State.OOMKilled, exit code, logs, events, host disk/memory and deploy/image digest. Exit 137 means SIGKILL (often OOM), 143 means SIGTERM (often shutdown) and 1 is a generic app failure.
Watch out: A measured rollback is fast containment; fixing capacity requires load tests and trend data so the incident does not recur.
Strengths: It can begin with docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory" and fewer surrounding controls.
Watch out: It silently accepts restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence, which makes the result hard to reproduce after promotion.
Strengths: An exit code is not a root cause; 137 can come from manual kill and 143 can be a forced timeout. Restart loops overwrite useful timeline signals, and pulling latest during an incident adds another variable.
Watch out: The platform adds an ownership and debugging layer; retain collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain as the direct check.
Interview signals & numbers to know
When this topic comes up
- docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory"
- collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain
- Failure signature: restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence
- Trade-off: A measured rollback is fast containment; fixing capacity requires load tests and trend data so the incident does not recur.
Benchmarks & rules of thumb
- 137
- SIGKILL/possible OOM
- 143
- SIGTERM/possible graceful stop
- 1
- generic non-zero application failure
Common mistakes & follow-ups
Common interview mistakes
- Treating a successful
docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory"as proof and skippingcollect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain. - Restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence
- Optimizing OOMKilled without accepting that a measured rollback is fast containment; fixing capacity requires load tests and trend data so the incident does not recur.
Likely interviewer follow-ups
- Why does
docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory"address OOMKilled here rather than through application code? - How would you distinguish healthy 137 from the failure “restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence” using
collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain? - When would this trade-off-“A measured rollback is fast containment; fixing capacity requires load tests and trend data so the incident does not recur”-justify a different 143 design?
docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory"-and one proof-collect digest, logs and memory.events, roll back the one release if healthy capacity is known, and verify SLO plus queue drain. Then name the boundary: restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Troubleshooting Production Outages (OOMKilled, Exit Codes 137, 143, 1) with generative AI interview Q&A and hands-on practice.