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
And then later, my python program calling the rust binary faces the exception BlockingIOError: [Errno 11] write could not complete without blocking when trying to write large amounts of text to its own stderr.
It seems strange that it is the same fd, but I've confirmed that F_GETFL indicates that the O_NONBLOCK bit of the python stream has been set with the call fcntl.fcntl(stream, fcntl.F_GETFL) & os.O_NONBLOCK
Does that make sense to call fcntl again and restore the original flags when binaries using ctrlc exit normally ?
The text was updated successfully, but these errors were encountered:
I don't know what volta.sh does internally, but it does not make sense to me that flags for a fd that is created with pipe2 could have anything to do with the Python process' stderr. Can you provide a smaller example to narrow down the variables? Maybe some simple Rust program with ctrlc and some interface to Python, which is then called from Python?
I've managed to reproduce the issue, and by simplifying it, I got to a point where Rust and ctrlc were no longer involved...
I was misdirected by strace, because the only call using F_SETFL was inside ctrlc, but it seems instead that it is directly inside the node binary that something strange happens.
2 successive calls F_GETFL (one from node, one from python) give different flags without any calls using F_SETFD
Hello !
I've encountered a situation where a rust binary (volta.sh to name it) uses
ctrlc
which changes the stream to non-blocking here :rust-ctrlc/src/platform/unix/mod.rs
Line 91 in 4c23810
And then later, my python program calling the rust binary faces the exception
BlockingIOError: [Errno 11] write could not complete without blocking
when trying to write large amounts of text to its ownstderr
.It seems strange that it is the same
fd
, but I've confirmed thatF_GETFL
indicates that theO_NONBLOCK
bit of the python stream has been set with the callfcntl.fcntl(stream, fcntl.F_GETFL) & os.O_NONBLOCK
Does that make sense to call
fcntl
again and restore the original flags when binaries usingctrlc
exit normally ?The text was updated successfully, but these errors were encountered: