mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] GH-89237: fix hang in proactor subprocess.wait_closed()
(GH-98572) (#98620)
GH-89237: fix hang in proactor `subprocess.wait_closed()` (GH-98572)
(cherry picked from commit ad1dc3ebb6
)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
parent
5fb3b61114
commit
8950689dce
3 changed files with 10 additions and 2 deletions
|
@ -60,6 +60,7 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin,
|
|||
self._pending_write = 0
|
||||
self._conn_lost = 0
|
||||
self._closing = False # Set when close() called.
|
||||
self._called_connection_lost = False
|
||||
self._eof_written = False
|
||||
if self._server is not None:
|
||||
self._server._attach()
|
||||
|
@ -136,7 +137,7 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin,
|
|||
self._empty_waiter.set_result(None)
|
||||
else:
|
||||
self._empty_waiter.set_exception(exc)
|
||||
if self._closing:
|
||||
if self._closing and self._called_connection_lost:
|
||||
return
|
||||
self._closing = True
|
||||
self._conn_lost += 1
|
||||
|
@ -166,6 +167,7 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin,
|
|||
if server is not None:
|
||||
server._detach()
|
||||
self._server = None
|
||||
self._called_connection_lost = True
|
||||
|
||||
def get_write_buffer_size(self):
|
||||
size = self._pending_write
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue