bregctl dev: a detached supervisor can inherit another start's output pipe, hanging parallel installed-dev tests
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
- 48/100
Direzione di ricerca
Start with crates/registry-bregctl/tests/dev_lifecycle.rs and trace Session::start() and run_supervisor() to see how the detached process handles inherited file descriptors. Review the macOS process spawning path and reproduce by running the installed-dev tests in parallel. Done when concurrent starts return within a bound and the regression test passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
Running the installed-dev tests in crates/registry-bregctl/tests/dev_lifecycle.rs in parallel can hang one test indefinitely on macOS. The hung test is waiting in Command::output() for EOF on its child's stdout pipe. lsof during a hang showed the write end of that pipe held open by a different test's detached bregctl dev supervisor and the breg server it started, so the read never ends.
Likely cause (medium-high confidence)
On macOS, Rust's standard library creates pipes with pipe() and sets FD_CLOEXEC afterwards, which is not atomic. When two threads call Session::start() at once, one bregctl dev start child can inherit the other thread's pipe write end before FD_CLOEXEC is set. That child then hands the descriptor to its detached supervisor (run_supervisor calls setsid() but keeps inherited descriptors), which keeps it open for the life of the dev environment. The fd numbers matched; the fork itself was not caught.
The same inheritance would affect an operator who starts two dev environments from one parent process, though that is less likely outside tests.
Candidate fixes
- When detaching the supervisor, close every inherited descriptor above 2 (or reopen 0 to 2 on
/dev/nulland close the rest). - Or spawn the supervisor with
posix_spawnandPOSIX_SPAWN_CLOEXEC_DEFAULT, passing only the descriptors it needs.
A regression test can start two sessions concurrently and assert that each dev start returns within a bound.
Found while verifying the external record projections branch (feat/breg-external-views).
- Lingua principale
- Rust
- Stelle
- 2
- Fork
- 0
- Merge medio
- 9h 48m
- PR unite (30g)
- 151
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di registrystack/registry-stack
-
area:breg enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
registrystack/registry-stack#2765 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
registrystack/registry-stack#2761 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
registrystack/registry-stack#2743 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
registrystack/registry-stack#2706 ·
I maintainer di solito rispondono entro 1 giorno
-
macOS contributor gates: Messaging config tests fail under the symlinked macOS temporary directoryAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
registrystack/registry-stack#2704 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di registrystack/registry-stack
Issue simili
-
[Bug] 建议把黑白主题设置同步到启动页面Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
AstrBotDevs/AstrBot-desktop#197 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
stackabletech/airflow-operator#898 ·
I maintainer di solito rispondono entro 1 giorno
-
2 advisory ignore entries no longer match anything (`bytes`, `time` already patched in `Cargo.lock`)Forse già presa @zyl71 l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100