Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Temp dataRootDir leaked on abnormal exit or startup failure

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

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
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing-qa

Direzione di ricerca

Start in src/harperLifecycle.ts by reading teardownHarper(), trackHarperProcess, signalHarperTree(), and startHarper(). Trace how dataRootDir and the log dir are created and how exit, SIGINT, SIGTERM, timeout, and startup paths are handled. Done means catchable abnormal exits clean temporary directories and startup removes stale harper-integration-test-* trees without affecting live runs.

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

Descrizione

teardownHarper() removes the run's temp dataRootDir, but only when it is actually reached — which is solely via each suite's own after/afterEach hook. On a failed, killed, or timed-out run the directory is left behind forever.

Mechanism (current main)

  • src/harperLifecycle.ts — teardownHarper() does rm(dataRootDir, { recursive: true, force: true, maxRetries: 10 }). This is the only place the data root is removed.
  • The interrupt-safety net, trackHarperProcess (registered on exit / SIGINT / SIGTERM), calls signalHarperTree() to kill processes. It never touches dataRootDir.
  • On SIGKILL, nothing runs at all.

So the cleanup path and the interrupt path are disjoint: every abnormal exit leaks a temp tree.

Observed impact

On a dev box this accumulated ~160 orphaned /tmp/harper-integration-test-* directories with no owning process, driving /tmp down to 3.1 G free, at which point runs failed with Disk quota exceeded.

Secondary consequence worth recording because it cost real time: on a machine where /tmp is a RAM-backed tmpfs, once it fills, every Bash call starts failing with a bare Exit code 1 while file tools keep working. Three separate agent sessions each burned their whole budget misdiagnosing that as something else. The disk symptom does not look like a disk symptom.

Relationship to the existing issues

This is a sibling of, but distinct from, the process/address leaks already tracked:

  • #13 — loopback pool leaks addresses from runners killed mid-shard (dead-PID sweep only runs when the pool is full)
  • #29 — detached Harper children orphaned permanently on SIGKILL/SIGHUP; reap guard covers only exit/SIGINT/SIGTERM

Those two are about processes and bound ports, and they are genuinely hard (SIGKILL is uncatchable from the parent, hence #29's child-side parent-liveness watchdog proposal). This one is about filesystem state, is not covered by either, and is untouched by the recent SIGINT/SIGTERM hardening commits.

Suggested direction

Wire dataRootDir (and the log dir) removal into the same trackHarperProcess reaper that already handles the catchable signals, so a Ctrl-C or a timeout cleans up. For the SIGKILL case the parent can do nothing, so the practical complement is a stale-directory sweep at startup: on startHarper, remove harper-integration-test-* trees whose owning PID is gone — the same liveness test #13 already applies to pool addresses.

Found by the qa-explorer campaign.

— Claude Opus 5.5

Lingua principale
TypeScript
Stelle
1
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 HarperFast/integration-testing

Tutte le issue di HarperFast/integration-testing

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.