-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Calling os.stat() on a named pipe used by asyncio.ProactorEventLoop.start_serving_pipe() will raise OSError #100573
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
Comments
The Footnotes
|
No matter what the client does, the server shouldn’t crash. So this is primarily an asyncio bug, right? Changing os.stat() to avoid this wouldn’t be a full fix. |
This issue can be resolved by handling f = self._proactor.accept_pipe(pipe)
except BrokenPipeError:
if pipe and pipe.fileno() != -1:
pipe.close()
self.call_soon(loop_accept_pipe) |
I'll have access to a Windows machine next week and I'll try to look into this then. The code looks tricky, and it's old. I wonder how many other things could cause PS. The code swallows PS2. Maybe this could be rewritten without the callback function, using a |
OK.
|
I ran the reproducer and verified that PR fixes this. I am OK with adding |
…indows) (pythonGH-100959) (cherry picked from commit 1bc7a73) Co-authored-by: Guido van Rossum <[email protected]>
…indows) (pythonGH-100959) (cherry picked from commit 1bc7a73) Co-authored-by: Guido van Rossum <[email protected]>
Thank you for investigation and correction. I have confirmed that the change in #100959 resolves the issue. |
Bug report
On Windows, several calls to
os.stat()
on the named pipe used byasyncio.ProactorEventLoop.start_serving_pipe()
will result in anOSError
. At this time, the first call toos.stat()
will cause aBrokenPipeError
on the server side.Steps to reproduce
Run the pipe server in Command Prompt:
Run the following script as client on another Command Prompt:
Display the following messages on the server side:
On client side, run
pipe_stat.py
repeat several times, thenOSError
occured:This problem seems to stem from commit 9eb3d54 between 3.8.0b3 and 3.8.0b4.
Your environment
Linked PRs
The text was updated successfully, but these errors were encountered: