New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emscripten test worker sometimes fails witth "BlockingIOError: write could not complete without blocking" #94026
Comments
The
|
I applied a hack on the buildbot worker host. Buildbot now starts NodeJS with |
…ipten `runtest_mp` test worker now handles :exc:`BlockingIOError` to work around non-blocking pipes on Emscripten.
Why is it set to non-blocking mode? Can it be set to blocking mode? Can it be replaced with an fd set to blocking mode? Can TextIOWrapper and BufferedWriter be made to handle this internally? Can we use an alternate channel for communication between processes? |
It is set to non-blocking mode because different rules apply to browser-like environments. It is not possible to change the property. In fact there is no way to even detect that the pipe fd is in non-blocking mode. I can only deduce that it is in non-blocking mode because tests sometimes fail when the system is under high load and the other side cannot read from the pipe fast enough. Emscripten tries hard to mimic a POSIX-like OS on top of a JavaScript and WebAssembly engine. Ultimately it is bound by restriction of the runtime environment. To handle the special case in Python's io module we would first have to detect the special case. That is not possible on Emscripten yet. The We could only use a temporary file for communication. Socket's don't work as expected. IPC and socketpair are not available. |
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
pythonGH-94253) Co-authored-by: Victor Stinner <vstinner@python.org>. (cherry picked from commit 199ba23) Co-authored-by: Christian Heimes <christian@python.org>
…onGH-94253) Co-authored-by: Victor Stinner <vstinner@python.org>
tiran commentedJun 20, 2022
Bug report
Sometimes test worker processes on wasm32-emscripten build bot fails with
BlockingIOError: write could not complete without blocking
. Example https://buildbot.python.org/all/#/builders/1044/builds/27/steps/10/logs/stdioThe error seems to occur at the end of a test job when the worker process returns its status to the control process. The control process runs CPython natively (
x86_64-pc-linux-gnu
in case of the build bot). The worker processes is wasm32-emscripten CPython with NodeJS as runner. I guess that every now and then, the test worker process produces output faster than the control process can consume from the pipe that connects stdout of the worker and read pipe of the control process. The runtime does not like blocking IO and returnsEAGAIN
.The text was updated successfully, but these errors were encountered: