Skip to content

Conversation

@cmaloney
Copy link
Contributor

@cmaloneycmaloney commented Jan 31, 2025

This reverts commit e1c4ba9.

This seems to be the commit where bots started failing. Not sure why.

cc: @vstinner

@vstinnervstinner merged commit 3ebe3d7 into python:mainJan 31, 2025
40 checks passed
@vstinner
Copy link
Member

Ok, let's revert until the issue is understood and fixed.

@vstinner
Copy link
Member

Example of failure, PPC64LE Fedora Stable 3.x: https://buildbot.python.org/#/builders/90/builds/5505

ERROR: test_nonblock_pipe_write_bigbuf (test.test_io.PyMiscIOTest.test_nonblock_pipe_write_bigbuf) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1250, in write self._flush_unlocked() ~~~~~~~~~~~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1282, in _flush_unlocked raise BlockingIOError( errno.EAGAIN, "write could not complete without blocking", 0) BlockingIOError: [Errno 11] write could not complete without blocking During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/test/test_io.py", line 4453, in _test_nonblock_pipe_write wf.write(msg) ~~~~~~~~^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1258, in write raise BlockingIOError(e.errno, e.strerror, written) BlockingIOError: [Errno 11] write could not complete without blocking During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1250, in write self._flush_unlocked() ~~~~~~~~~~~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1282, in _flush_unlocked raise BlockingIOError( errno.EAGAIN, "write could not complete without blocking", 0) BlockingIOError: [Errno 11] write could not complete without blocking During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/test/test_io.py", line 4462, in _test_nonblock_pipe_write wf.write(msg) ~~~~~~~~^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1258, in write raise BlockingIOError(e.errno, e.strerror, written) BlockingIOError: [Errno 11] write could not complete without blocking During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/test/test_io.py", line 4421, in test_nonblock_pipe_write_bigbuf self._test_nonblock_pipe_write(16*1024) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/test/test_io.py", line 4446, in _test_nonblock_pipe_write with rf, wf: ^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 482, in __exit__ self.close() ~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1309, in close self.flush() ~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1270, in flush self._flush_unlocked() ~~~~~~~~~~~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1282, in _flush_unlocked raise BlockingIOError( errno.EAGAIN, "write could not complete without blocking", 0) BlockingIOError: [Errno 11] write could not complete without blocking ====================================================================== ERROR: test_nonblock_pipe_write_smallbuf (test.test_io.PyMiscIOTest.test_nonblock_pipe_write_smallbuf) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1250, in write self._flush_unlocked() ~~~~~~~~~~~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1282, in _flush_unlocked raise BlockingIOError( errno.EAGAIN, "write could not complete without blocking", 0) BlockingIOError: [Errno 11] write could not complete without blocking During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/test/test_io.py", line 4453, in _test_nonblock_pipe_write wf.write(msg) ~~~~~~~~^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1258, in write raise BlockingIOError(e.errno, e.strerror, written) BlockingIOError: [Errno 11] write could not complete without blocking During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1250, in write self._flush_unlocked() ~~~~~~~~~~~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1282, in _flush_unlocked raise BlockingIOError( errno.EAGAIN, "write could not complete without blocking", 0) BlockingIOError: [Errno 11] write could not complete without blocking During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/test/test_io.py", line 4462, in _test_nonblock_pipe_write wf.write(msg) ~~~~~~~~^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1258, in write raise BlockingIOError(e.errno, e.strerror, written) BlockingIOError: [Errno 11] write could not complete without blocking During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/test/test_io.py", line 4427, in test_nonblock_pipe_write_smallbuf self._test_nonblock_pipe_write(1024) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/test/test_io.py", line 4446, in _test_nonblock_pipe_write with rf, wf: ^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 482, in __exit__ self.close() ~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1309, in close self.flush() ~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1270, in flush self._flush_unlocked() ~~~~~~~~~~~~~~~~~~~~^^ File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le/build/Lib/_pyio.py", line 1282, in _flush_unlocked raise BlockingIOError( errno.EAGAIN, "write could not complete without blocking", 0) BlockingIOError: [Errno 11] write could not complete without blocking 

@cmaloney
Copy link
ContributorAuthor

The test does a lot of writes until it blocks, catches that exception, then does a "readall" from the pipe (to get it so a write shouldn't block) followed by a small write of "BLOCKED" which is expected to never block. That write blocks, which raises an exception and gets the pile of stack traces. As the test exits, close / flush happens on each of the objects which tries to flush the buffers, resulting in more writes, which also block (and get to the full set of exceptions).

Makes it feel to me like either the .read() / .readall() isn't emptying the pipe, or the fact the pipe is no longer full isn't updating before the next write() occurs. Nothing concrete though. The shortcut made a bit faster, but I'm pretty sure _io.BufferedIO is still faster than _pyio.BufferedIO, and _io.BufferedIO is also run through this test...)

@cmaloneycmaloney deleted the revert_bufferedio_readall branch January 31, 2025 09:02
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Feb 7, 2025
Sign up for freeto 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.

2 participants

@cmaloney@vstinner