bregctl dev: a detached supervisor can inherit another start's output pipe, hanging parallel installed-dev tests
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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).
- Langage dominant
- Rust
- Étoiles
- 2
- Forks
- 0
- Merge moyen
- 9 h 48 min
- PR mergées (30 j)
- 151
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de registrystack/registry-stack
-
area:breg enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
registrystack/registry-stack#2765 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
registrystack/registry-stack#2761 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
registrystack/registry-stack#2743 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
registrystack/registry-stack#2706 ·
Les mainteneurs répondent en général sous 1 jour
-
macOS contributor gates: Messaging config tests fail under the symlinked macOS temporary directoryOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
registrystack/registry-stack#2704 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de registrystack/registry-stack
Issues similaires
-
[Bug] 建议把黑白主题设置同步到启动页面Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
AstrBotDevs/AstrBot-desktop#197 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
stackabletech/airflow-operator#898 ·
Les mainteneurs répondent en général sous 1 jour
-
2 advisory ignore entries no longer match anything (`bytes`, `time` already patched in `Cargo.lock`)Peut-être pris @zyl71 l’a pris aujourd’hui. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100