fix(run): prevent stdio pipe buffer deadlock in dashboard mode#171
Open
A9G-Data-Droid wants to merge 1 commit into
Open
Conversation
`src/run/ralph-process.ts:216` - changed ["ignore", "pipe", "pipe"] to ["ignore", "ignore", "ignore"]. - When the dashboard is active, stdout/stderr were piped but never drained; after ~64KiB accumulated the kernel blocked bash's next write indefinitely. - Switching to "ignore" eliminates the pipes entirely — the dashboard reads everything from files already, so nothing is lost. - The detach() method's if (child.stdout) guards were already correct for this case. `tests/run/ralph-process.test.ts` - updated the existing stdio assertion - added "detach does not throw when stdout/stderr are null (ignore stdio mode)" to make the guard's intent explicit and prevent regression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spawnRalphLoop()spawnedralph_loop.shwithstdio: ["ignore", "pipe", "pipe"]but never attached data listeners, so the kernel pipe buffers filled after ~64 KiB of output (~10–30 min of runtime) and blocked bash's next write forever.["ignore", "ignore", "ignore"]— the dashboard reads all state from files already, so no output is lost.inheritStdio: false.Closes #170
Changes
src/run/ralph-process.ts— one-line stdio fix inspawnRalphLoop()tests/run/ralph-process.test.ts— updated assertion + addeddetachnull-guard regression testTest plan
tests/run/ralph-process.test.ts— 39/39 passtests/cli.test.tsunrelated to this change)bmalph runfor 10+ minutes and confirm loop does not freeze