Skip to content

fix: non-blocking chunk I/O — prevent broken pipe on fast chunk streams (#116) - #108

Merged
blaspat merged 1 commit into
mainfrom
fix/nonblocking-chunk-io
Aug 11, 2026
Merged

fix: non-blocking chunk I/O — prevent broken pipe on fast chunk streams (#116)#108
blaspat merged 1 commit into
mainfrom
fix/nonblocking-chunk-io

Conversation

@blaspat

@blaspat blaspat commented Aug 11, 2026

Copy link
Copy Markdown
Owner

What

Chunked exec streaming disconnects with "broken pipe" around 22-24MB because the server's chunk handler does synchronous file I/O (cs.file.write + cs.file.flush) inside the async WebSocket dispatch loop. When chunks arrive rapidly, the event loop blocks on disk writes, falls behind on reading the next message, the TCP receive buffer fills, and the connection resets.

Fix

Wrap file write and flush in loop.run_in_executor(None, ...) so disk I/O runs in a thread pool and never blocks the event loop.

Tested

  • pytest tests/ -q — 46/46 pass

…prevent event loop stall (#116)

Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
@blaspat
blaspat merged commit 9e1a772 into main Aug 11, 2026
2 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