Skip to content

RAL-194: one walk of every process's open files for a pass; sh's exit status ahead of a broken pipe - #282

Merged
Castor-o7 merged 2 commits into
mainfrom
ral-194-fd-scan-and-script-status
Nov 15, 2026
Merged

Castor-o7 merged 2 commits into
mainfrom
ral-194-fd-scan-and-script-status

Conversation

@Castor-o7

Copy link
Copy Markdown
Owner

Follow-ups to RAL-192 and RAL-189.

(a) One walk for a pass

Each lock whose taker had exited walked every process's /proc/<pid>/fd for itself, so a pass over many slots walked them once per slot, and the possibly-hung check twice that.

  • lock_holder::Pass shares one walk across all the locks of a pass. rally stalls uses one pass per sample; the brief's in_flight uses one over every project's locks.
  • Each process the walk names is still checked afresh by device and inode.
  • A lock the walk found nothing for is looked for alone before it's called a blind spot, since its holder may be newer than the walk.
  • lock_holder::read is unchanged for callers: a pass of its own.

(b) sh's exit status first

script::write returned the failed send ("Broken pipe") ahead of sh's exit status when sh couldn't open the file and the text was too long for the pipe. The exit status now comes first, with the failed send beside it.

Tests

  • Three locks held by an inherited descriptor are read in one pass with one walk, each naming its own job; a pass not told of its locks still reads rightly.
  • A 4 MiB text to a directory that doesn't exist reports sh's exit status and the broken pipe.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test pass locally. On this machine the brief's in_flight reads the same 10 held locks as the installed CLI.

docs/roadmap.md will conflict with #281 (both add an entry at the end); I'll merge main in once that lands.

🤖 Generated with Claude Code

Castor-o7 and others added 2 commits November 15, 2026 18:07
… status ahead of a broken pipe

(a) Each lock whose taker had exited walked every process's /proc/<pid>/fd for itself. A
lock_holder::Pass now shares one walk across all the locks of a stalls or in_flight pass.
Each process the walk names is still checked afresh by device and inode, and a lock the
walk found nothing for is looked for alone before it's called a blind spot.

(b) script::write returned the failed send (Broken pipe) ahead of sh's exit status when sh
couldn't open the file and the text was too long for the pipe. The exit status now comes
first, with the failed send beside it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Castor-o7
Castor-o7 merged commit 5e6fd9f into main Nov 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant