Skip to content

Conversation

@sbromberger
Copy link
Member

Closes #28

@rogerpearce
Copy link
Collaborator

rogerpearce commented Dec 12, 2025

There's an issue. If the process exits before all of the stderr has been read, then it gets lost. Looks like it's missing a double check on reading remaining lines in the pipes after process closes. Example:

In [13]: mu.welcome()
======================================
 YY    YY     GGGGGG      MM     MM
Out[13]: 0

@rogerpearce
Copy link
Collaborator

It is still not streaming. Add some sleeps between cerr output and you will see, like:

comm.welcome(std::cerr);
 // Sleep for 2 seconds
 std::this_thread::sleep_for(std::chrono::seconds(2));
 comm.welcome(std::cerr);
 // Sleep for 2 seconds
 std::this_thread::sleep_for(std::chrono::seconds(2));
  comm.welcome(std::cerr);

The problem is that select.select ONLY works with file descriptors (fds) so that is all immediately ending.

@rogerpearce
Copy link
Collaborator

Another way to simplify if you wanted to is to only allow streaming form stderr and wait to even read stdout until after the process completes. Any future progress type stuff could be streamed to stdout.

@rogerpearce rogerpearce mentioned this pull request Dec 15, 2025
@rogerpearce rogerpearce merged commit 4e4a12f into master Dec 17, 2025
1 of 2 checks passed
@sbromberger sbromberger deleted the sbromberger/stream-stderr branch December 19, 2025 20:13
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.

Figure out a way to stream STDERR for long-running processes

3 participants