File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,16 @@ def factory():
141
141
asyncio .ensure_future (self ._autoclose ())
142
142
143
143
def _child_connected (self , reader , writer ):
144
- self .server [0 ].close ()
144
+ # HACK: We should shut down the pipe server here.
145
+ # However, self.server[0].close() is racy, and will cause an
146
+ # invalid handle error if loop.start_serving_pipe has not finished
147
+ # its work in the background.
148
+ # The bug manifests itself here frequently as the event loop is
149
+ # reopening the server as soon as a new client connects.
150
+ # There is still a race condition in the AsyncioParentComm
151
+ # creation/destruction, but it is unlikely to cause problems
152
+ # in most practical cases.
153
+ assert self .server is not None
145
154
self .server = None
146
155
self .reader = reader
147
156
self .writer = writer
You can’t perform that action at this time.
0 commit comments