Interview's MateDocker
Interview's Mate

Docker

Compose · Networking · Security · Ops

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Docker topics
Lesson 140/ 160
07. CI/CD, Registries & Production Operations

Troubleshooting Production Outages (OOMKilled, Exit Codes 137, 143, 1)

Decode OOMKills and common exit codes to restore services quickly.

IntermediateOOMKilled · 1373 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

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

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

Concrete OOMKilled setup

docker ps -a; docker inspect -f {{.State.ExitCode}}:{{.State.OOMKilled}}:{{.Image}} api; docker events --since 30m; journalctl -k -g "Out of memory"

Key takeaway: Prove 137 with 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.

Deliberate failure test

Exercise this failure safely: restarting endlessly until the symptoms vanish, or declaring OOM solely from 137 without checking kernel and app memory evidence.

Key takeaway: A measured rollback is fast containment; fixing capacity requires load tests and trend data so the incident does not recur.

How it works, step by step

Step 1 of 4
Design

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

Stabilize service and preserve evidence before experimenting, then prove the triggering condition and recovery.
Key numbers at this step
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 drain in 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

Explicit OOMKilled
Best for: Decode OOMKills and common exit codes to restore services quickly, with a reviewed runbook.

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.

Ambient default
Best for: Short-lived 137 experiments with low blast radius.

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.

Managed 143
Best for: Teams that centralize 143 policy across many workloads.

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 skipping collect 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?
Interview tip: Give one concrete operation-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

Loading quiz

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.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Running Docker on Cloud VMs (AWS EC2, DigitalOcean, Hetzner)
Next topic
Limitations of Single-Host Docker in Large-Scale Production