Repository navigation
fix(cli): reject worker --file FIFOs and bound --spec-fd - #220
nillikechatchat wants to merge 6 commits into
Conversation
Worker --file opened the path with a blocking File::open, so a FIFO without a writer hung. Unix --spec-fd opened /dev/fd/N and read JSON until EOF with no time bound, unlike Windows --spec-handle. Open --file with O_NONBLOCK and require a regular file. Read --spec-fd with a 1 MiB / 2s bound, keep stdin (0) valid, and reject devices. Fixes higress-group#217 Signed-off-by: nillikechatchat <yuanhenglizhen2050@163.com> Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
|
@johnlanni ready for review. Fixes #217. Candidate SHA backend-shard (unit) failed in |
Review: Worker file fix is sound; setup FD timeout remains incompleteReviewed commit: Importance of the original issue: medium (P2), mainly automation reliability. A Worker The Worker Change needed before merge: Please:
Recommendation: retain the Worker file fix and complete the cross-platform setup-reader behavior before merging. |
macOS /dev/fd/N follows dup semantics, so opening with O_NONBLOCK does not bound an inherited blocking pipe. Reuse the shared poll reader without changing file-status flags. Keep the 1 MiB / 2s bound, stdin FD 0, regular-file and pipe acceptance, and device rejection. Watchdog subprocesses cover empty pipes and complete JSON without EOF. Signed-off-by: nillikechatchat <yuanhenglizhen2050@163.com> Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com> Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
|
@johnlanni follow-up for the macOS Unix Linux focused tests: Hosted on this SHA:
The earlier unit-shard failures in unchanged This checkout has no macOS validation target, so the watchdog tests have not been executed on macOS here. The same tests are in the candidate. Shared reader: |
Follow-up review (2026-10-29): macOS tests pass; shared FIFO-open gap remainsReviewed commit: I ran Correction to my earlier impact description: at this head, Remaining P2 finding: the shared Please coordinate the helper correction with #219:
Merge recommendation: retain the current improvements and address this remaining shared-reader gap before merge. Its priority remains medium; the staged setup path does not establish an ongoing public CLI outage. GitHub currently reports the branch behind main, so the final candidate also needs a base refresh, required checks, and code-owner approval. |
…-fifoCo-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
Copy the shared /dev/fd/N O_NONBLOCK reopen from the secret-fd reader. Linux File::open can stall on a named FIFO before poll sees the 2s --spec-fd deadline. Inherited file-status flags stay unchanged. Watchdog coverage includes an empty named FIFO and a closed writer that must finish inside the deadline. Signed-off-by: nillikechatchat <yuanhenglizhen2050@163.com> Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
…ix/cli-worker-file-fifoCo-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
|
@johnlanni Linux named-FIFO follow-up is on
Watchdog coverage:
Linux focused tests at This checkout has no macOS validation target, so the watchdog tests have not been executed on macOS here. Hosted CI after this push is the remaining remote evidence. Human review remains the default. Shared reader: |
Problem
Worker
--fileopened the path with a blockingFile::open, so a FIFO without a writer hung. Unix--spec-fdopened/dev/fd/Nand read JSON until EOF with no time bound, unlike Windows--spec-handle(1 MiB / 2s). Opening/dev/fd/NwithO_NONBLOCKalso does not bound an inherited blocking pipe on macOS.Change
--filewithO_NONBLOCK/O_NOCTTYand require a regular file, matching--request-file.--spec-fdthrough the sharedpollhelper: accept inherited regular files and pipes, keep stdin (0) valid, reject devices, and stop at 1 MiB or 2s.Fixes #217
Validation
cargo test --locked -p hiroute-cli --lib -- unix_bounded_fd json_from_fd submission_filehiroute-cpa-bridgedid not recur on this SHA