Skip to content

fix: complete pod survival across restarts (KillMode + degraded-survivor adoption)#67

Merged
dndungu merged 2 commits into
mainfrom
fix/issue-53-killmode-recovery
Jul 10, 2026
Merged

fix: complete pod survival across restarts (KillMode + degraded-survivor adoption)#67
dndungu merged 2 commits into
mainfrom
fix/issue-53-killmode-recovery

Conversation

@dndungu

@dndungu dndungu commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Problem

Live verification of #53's fix on v1.16.0 showed containers survive the restart, but two gaps remained:

  1. systemd killed the pods' conmons anyway. podman run from spark.service puts conmon + containers in the service cgroup; default KillMode=control-group made every stop hang 90s waiting for them, then SIGKILL the conmons (observed: State 'final-sigterm' timed out. Killing process ... (conmon)), leaving surviving pods Degraded.
  2. Degraded survivors got no quota. RecoverPods gated adoption on pod-level Running; a Degraded survivor (dead infra conmon, live workload) kept serving with an empty ledger entry — silent overcommit again.

Fix

  • deploy/spark.service: KillMode=process + TimeoutStopSec=30 — stop signals only the spark binary; pods and their conmons are untouched, stops are instant.
  • RecoverPods: adopt store-Running pods on presence in podman; a genuinely dead pod loses the quota one reconcile tick later via the per-container status path.

Testing

  • TestRecoverPods_DegradedSurvivorStillReclaimsQuota (new) + existing recovery/adoption tests.
  • Full suite -race green, vet + staticcheck clean.

Live acceptance after deploy: systemctl restart spark.service with a running pod must return in seconds (no 90s hang), pod keeps its container ID with conmon intact, podman state stays Running, and /api/v1/resources shows the allocation re-registered.

Refs #53

dndungu added 2 commits July 9, 2026 21:37
…pod conmons (refs #53)

podman run from spark.service places conmon and container processes in
the service cgroup. With the default KillMode=control-group, systemctl
stop waits for them, times out after 90s on every restart, and SIGKILLs
the conmons — degrading the very pods the no-drain shutdown preserved.
Signal only the spark process; TimeoutStopSec=30 keeps a clean bound.
…ing (refs #53)

Live verification caught a surviving pod sitting in podman state
Degraded at startup (its infra conmon was killed during the restart)
while the workload container ran on. RecoverPods gated quota adoption
on the pod-level Running flag, so the survivor kept serving with no
ledger entry. Adoption now keys on presence in podman; if the pod is
genuinely dead the next reconcile tick releases the quota through the
normal per-container status path.
@dndungu dndungu merged commit f8b2eda into main Jul 10, 2026
1 check passed
@dndungu dndungu deleted the fix/issue-53-killmode-recovery branch July 10, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant