Skip to content

Commit 1f8fdba

Browse files
committed
Fix future issue in sock_connect()
CPython fixed the same issue in python/cpython#10419. Seems like under pressure, more write callbacks may happen before _remove_writer() is called, so we should check for done(). Fixes #378
1 parent b7048b9 commit 1f8fdba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

uvloop/loop.pyx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,8 @@ cdef class Loop:
10591059
return fut
10601060

10611061
cdef _sock_connect_cb(self, fut, sock, address):
1062-
if fut.cancelled():
1062+
if fut.done():
1063+
# Refs #378: this may be called multiple times.
10631064
return
10641065

10651066
try:

0 commit comments

Comments
 (0)