Skip to content

Commit ab6333f

Browse files
gh-128002: fix tsan race in closing socket in test_sslproto (#131399)
1 parent 812074e commit ab6333f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Lib/test/test_asyncio/functional.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,15 @@ def stop(self):
217217
pass
218218
finally:
219219
super().stop()
220-
221-
def run(self):
222-
try:
223-
with self._sock:
224-
self._sock.setblocking(False)
225-
self._run()
226-
finally:
220+
self._sock.close()
227221
self._s1.close()
228222
self._s2.close()
229223

224+
225+
def run(self):
226+
self._sock.setblocking(False)
227+
self._run()
228+
230229
def _run(self):
231230
while self._active:
232231
if self._clients >= self._max_clients:

0 commit comments

Comments
 (0)