engine.pid that is a FIFO blocks the run pid reader forever

Đã đóng
#868 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@dracic đang làm issue này rồi.

Từ ngày 9/10/2026.

  • #10 của @dracic — đang mở
  • #873 của @dracic — đã merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Start with engine_liveness in src/bmad_loop/runs.py, which reads engine.pid with Path.read_text(), and trace its callers in prune_sessions and the evidence scan. Reproduce by creating a FIFO named engine.pid in a temporary run dir and running bmad-loop cleanup, which should hang. Done means the reader opens non-blocking, checks with fstat that the file is regular, and reports a non-regular file as unreadable/unknown rather than as no engine.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The shared run pid reader (engine_liveness in src/bmad_loop/runs.py) reads engine.pid with Path.read_text(). If engine.pid is a FIFO, opening it blocks until a writer appears, so bmad-loop cleanup hangs and the TUI's cleanup worker never finishes or shows its result.

A FIFO there needs a broken or hostile run dir, but every path that probes run liveness goes through this reader: the existing cleanup's prune_sessions, and, since #864, the evidence scan when the backend is unavailable.

Proposed fix: open with O_NONBLOCK (where available), check that the descriptor is a regular file with fstat, then read it. A non-regular file keeps the existing unreadable/unknown semantics, so it is reported, never read as "no engine".

Found in review of the #864 fix.

Ngôn ngữ chính
Python
Star
174
Fork
72
Merge trung bình
17 giờ 56 phút
Pull request đã merge (30 ngày)
95

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bmad-code-org/bmad-loop

Tất cả issue của bmad-code-org/bmad-loop

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.