Record the holder pid in /tmp/hello-s.claim

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

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
bash, macos, shell
Ambito
testing, tooling

Direzione di ricerca

Start with tests/bench-suite.sh and the lock handling for /tmp/hello-s.claim; read the linked #501 discussion and the reverted changes in f9d6cb9 and 728668c for the timeout cases. Update the holder PID recording and checks described in the proposal, then verify the three failure cases: interruption, orb run creating the lock before timeout, and polling timeout while another suite holds it.

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

Descrizione

tests/bench-suite.sh serializes the /tmp/hello-s reclaim with a mkdir lock, /tmp/hello-s.claim (#501). The lock records no holder, so three cases leave it behind or cannot be told apart:

  • A kill -9 while the lock is held, or Ctrl-C between the mkdir and T1_HELLO_CLAIM=/tmp/hello-s.claim, leaves the lock. Every later suite waits 10 seconds and stops with "is held", and that message cannot say whether the holder is still alive (https://github.com/sysprog21/elfuse/pull/501#discussion_r4510350038).
  • On OrbStack, an orb run that makes the lock and then times out loses its ok. The suite stops with "cannot create" and the lock is left, not recorded.
  • That empty output looks the same as a polling orb run that times out while another suite holds the lock, so recording the lock on empty output would let the EXIT cleanup remove a live suite's lock (tried in f9d6cb9, reverted in 728668c).

Proposal: write $$ into the lock directory at mkdir time. The "is held" message prints that pid and whether kill -0 finds it. On empty output, the suite records the lock only when it holds this suite's pid. A dead holder's lock is never removed automatically, because two waiters doing that would bring back the race the lock closes.

Refs #501

Lingua principale
C
Stelle
287
Fork
33
Merge medio
2g 17h
PR unite (30g)
18

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 sysprog21/elfuse

Tutte le issue di sysprog21/elfuse

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.