bregctl dev: a detached supervisor can inherit another start's output pipe, hanging parallel installed-dev tests
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 0
- Merge trung bình
- 9 giờ 48 phút
- Pull request đã merge (30 ngày)
- 151
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của registrystack/registry-stack
-
area:breg enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
registrystack/registry-stack#2765 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
registrystack/registry-stack#2761 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
registrystack/registry-stack#2743 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
registrystack/registry-stack#2706 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS contributor gates: Messaging config tests fail under the symlinked macOS temporary directoryĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
registrystack/registry-stack#2704 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của registrystack/registry-stack
Issue tương tự
-
[Bug] 建议把黑白主题设置同步到启动页面Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
AstrBotDevs/AstrBot-desktop#197 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
stackabletech/airflow-operator#898 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2 advisory ignore entries no longer match anything (`bytes`, `time` already patched in `Cargo.lock`)Có thể đã có người làm @zyl71 đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100