Local Docker runs: a user job's whole log is read into memory, and containers have no log-size or process-count limits

Aperta
#222 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, python

Direzione di ricerca

Start with services/pipeline/src/pipeline/process/docker_executor.py, especially logs() near line 639, then read process/reconcile.py around lines 248–265 to understand when logs are fetched relative to the row lock. Inspect the Docker container spec and its fixture for resource limits, using the Kubernetes path as a reference. Done means the acceptance test reads logs beyond max_bytes without buffering them all, and the fixture includes the new limits.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug queue: k8s compute (K) ready

Found in the 2026-11-29 whole-repo review. Unbounded read verified; the crash loop is inferred from the code path.

Problem

In services/pipeline/src/pipeline/process/docker_executor.py the logs() method (~line 639) fetches a finished container's entire log and only afterwards trims it to max_bytes. The caller (process/reconcile.py ~248-265) does this while holding a database row lock and an open connection. The container spec sets no log size cap, no process-count limit, and no read-only root file system for runs on the platform image. The Kubernetes path already has all of these.

How it goes wrong

A job that prints in a loop for its whole time limit writes gigabytes of log. On exit the worker reads it all and is killed for memory; on restart it picks up the same run and is killed again. Separately, Docker's default log driver keeps those logs on the host disk with no limit — consistent with the earlier disk-full incident.

Suggested fix

Ask Docker for only the last N bytes (or read in bounded chunks and stop at max_bytes); fetch the log before taking the row lock; add LogConfig max size/files, PidsLimit, a read-only root with a size-limited /tmp.

Acceptance criteria

  • Test: a container that emitted far more than max_bytes is read without buffering it all
  • Container spec fixture includes the new limits
Lingua principale
Python
Stelle
0
Fork
2
Merge medio
8h 26m
PR unite (30g)
47

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TechTraverse/stac-higher

Tutte le issue di TechTraverse/stac-higher

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.