question-streaks lock: release removes a lock it no longer owns

Aperta
#192 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bash, shell
Ambito
tooling

Direzione di ricerca

Start in bin/question-streaks.sh at the age check [ "$age" -gt 120 ] that reclaims $LOCK, then follow the release path that calls rmdir without checking ownership. Read the owner-token fix referenced from PR #191 and port that token write/check pattern here, re-checking the token before each rename under the lock. Add a test where holder A stalls past 120 s, B reclaims, and A's release leaves B's lock intact; done when that test and the existing script tests pass.

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

Descrizione

bin/question-streaks.sh reclaims a lock older than 120 s by age ([ "$age" -gt 120 ] && { rmdir "$LOCK"), and its release removes the lock without checking who holds it. A holder that stalls past 120 s then deletes the reclaimer's lock, and a third writer can race the second.

Same class as the P0 found in the thread index on https://github.com/STRML/autodream/pull/191, fixed there with an owner token that release checks before rmdir, and a token re-check before every rename under the lock. Port that pattern here, with a test where A's aged lock is reclaimed by B and A's release must leave B's lock alone.

Lingua principale
Shell
Stelle
0
Fork
2
Merge medio
11h 31m
PR unite (30g)
26

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 STRML/autodream

Tutte le issue di STRML/autodream

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.