You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(shell): executor buffers output unbounded and pipelines hang on unbounded producers #929
Two related defects in DirectShellExecutor (src/synapsekit/shell/executor.py):
Unbounded output buffering (OOM/DoS)._run_one and _run_pipeline use process.communicate(), which reads the entire child stdout/stderr into memory. max_output_bytes is applied only afterward in _decode, so the advertised bound is not enforced during reading — a continuous producer (cat /dev/zero, yes) buffers unbounded RAM.
Pipeline hang on an unbounded producer._run_pipeline runs stages sequentially and buffers each stage fully before starting the next, so yes | head -1 never terminates (yes never receives SIGPIPE because head hasn't started).
Fix: stream stdout/stderr with a hard byte cap that terminates the process on overflow (marking the output truncated), for both single commands and pipeline stages. Add regression tests using an unbounded producer with a small max_output_bytes asserting bounded output and prompt return.
Fixed in #925 (commit 3df9ac9) — replaced communicate() with a streaming _drain() under a hard byte cap that kills the child at the cap; regression tests cover bounded output and a non-hanging pipeline. CI green. Lands on main when #925 merges.
Activity
fix(shell): bound subprocess output and stop misreading quoted args
fix(shell): bound subprocess output and stop misreading quoted args
AmitoVrito commentedon Aug 12, 2026
Fixed in #925 (commit
3df9ac9) — replacedcommunicate()with a streaming_drain()under a hard byte cap that kills the child at the cap; regression tests cover bounded output and a non-hanging pipeline. CI green. Lands on main when #925 merges.