Skip to content

fix: preserve buffered Open3 pipe data before EOF - #1288

Merged
fglock merged 4 commits into
masterfrom
fix/issue-1263
Sep 8, 2026
Merged

fix: preserve buffered Open3 pipe data before EOF#1288
fglock merged 4 commits into
masterfrom
fix/issue-1263

Conversation

@fglock

@fglock fglock commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • make ProcessInputHandle::eof consult the synchronized reader buffer rather than peek the Java input stream
  • preserve buffered Open3 stdout and stderr until read, preventing handler loss and a child/stdin deadlock
  • add a permanent regression for EOF, handler short-circuiting, stdin close, and child reaping

Fixes #1263.

Validation

  • prove src/test/resources/unit/ipc_open3_buffered_eof.t (system Perl)
  • timeout 60 ./jperl src/test/resources/unit/ipc_open3_buffered_eof.t
  • timeout 60 ./jperl --interpreter src/test/resources/unit/ipc_open3_buffered_eof.t
  • make
  • make check-links

Generated with Codex

@fglock
fglock marked this pull request as ready for review September 7, 2026 20:06
fglock and others added 3 commits September 8, 2026 08:29
Make ProcessInputHandle EOF synchronize with the asynchronous reader buffer
instead of peeking the underlying stream. This prevents Open3 consumers from
dropping buffered stdout and stderr or blocking while a child awaits stdin.

Add regression coverage for buffered EOF, handler short-circuiting, stdin
closure, and child reaping on both output pipes.

Fixes #1263

Generated with [Codex](https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
Keep the #1263 buffered-pipe regression portable across Windows and Unix
process pipes by accepting either LF or CRLF in child output assertions.

Generated with [Codex](https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
Run the buffered-pipe regression through cmd.exe on Windows instead of a
Unix shell command, so the stdin-to-stdout/stderr lifecycle is exercised
reliably on both CI platforms.

Generated with [Codex](https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
Keep #1263 process-pipe regression portable while retaining proof that the
Windows child emitted buffered stderr data.

Generated with [Codex](https://openai.com/codex/)
Co-Authored-By: Codex <codex@openai.com>
@fglock
fglock merged commit a1ec0e7 into master Sep 8, 2026
2 checks passed
@fglock
fglock deleted the fix/issue-1263 branch September 8, 2026 09:05
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.

IPC::Open3 pipe reads race with eof and hang IPC::Open3::Utils tests

1 participant