fix(core): don't hang when workspace contains a named pipe#35289
fix(core): don't hang when workspace contains a named pipe#35289AgentEnder merged 1 commit intomasterfrom
Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 993ce38
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud has identified a possible root cause for your failed CI:
We identified that the maven-batch-runner:_package failure is a pre-existing environment issue unrelated to this PR's changes, which are confined to packages/nx/src/native/walker.rs. The same Maven shade plugin error ("error in opening zip file") was confirmed to exist on the master branch, indicating a build infrastructure problem that predates this PR.
No code changes were suggested for this issue.
Trigger a rerun:
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
|
Thanks for fixing! 😄
I think a symlink could theoretically point to a non-hashable file, like a fifo; for example: mkfifo test
ln -s test test2I think Is that handled? (Other edge cases include symlinks to symlinks to symlinks to FIFO, etc.) |
Current Behavior
If a workspace contains a named pipe (FIFO) — e.g. created via
mkfifo— anynxcommand that walks the workspace (e.g.nx show projects) hangs forever with no output. The native file hasher callsstd::fs::readon the FIFO, which blocks indefinitely waiting for a writer.Expected Behavior
Special files that cannot be meaningfully hashed as workspace content (FIFOs, sockets, block/char devices) are skipped by the native walker, so
nxcommands complete normally.Implementation Notes
nx_walker(parallel and wasm variants) so only regular files and symlinks are emitted asNxFileentries. Uses the metadata already fetched formod_time, so there is no extra syscall cost.std::fs::read.skips_named_pipes) that creates a FIFO withnix::unistd::mkfifoand asserts the walker skips it.Related Issue(s)
Fixes #35228