summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2023-01-13 21:24:57 (GMT)
committerGitHub <noreply@github.com>2023-01-13 21:24:57 (GMT)
commit1bc7a736837272b15ad3a7aa472977bc720d1033 (patch)
tree28668baf5172dc5758dc1b95037eaeee2d03d736 /Lib/asyncio
parentc00eb1eae6af3ee5b7e314add4606da4521bb8c5 (diff)
downloadcpython-1bc7a736837272b15ad3a7aa472977bc720d1033.zip
cpython-1bc7a736837272b15ad3a7aa472977bc720d1033.tar.gz
cpython-1bc7a736837272b15ad3a7aa472977bc720d1033.tar.bz2
GH-100573: Fix server hang caused by os.stat() on named pipe (Windows) (#100959)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/windows_events.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
index 4dad436..c9a5fb8 100644
--- a/Lib/asyncio/windows_events.py
+++ b/Lib/asyncio/windows_events.py
@@ -366,6 +366,10 @@ class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
return
f = self._proactor.accept_pipe(pipe)
+ except BrokenPipeError:
+ if pipe and pipe.fileno() != -1:
+ pipe.close()
+ self.call_soon(loop_accept_pipe)
except OSError as exc:
if pipe and pipe.fileno() != -1:
self.call_exception_handler({
@@ -377,6 +381,7 @@ class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
elif self._debug:
logger.warning("Accept pipe failed on pipe %r",
pipe, exc_info=True)
+ self.call_soon(loop_accept_pipe)
except exceptions.CancelledError:
if pipe:
pipe.close()