You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
close_socket() was interacting with the protocol, namely calling
protocol.receive_of(), without locking the mutex. This created the
possibility of a race condition.
If two threads called receive_eof() concurrently, the second one
could return before the first one finished running it. This led to
receive_eof() returning (in the second thread) before the connection
state was CLOSED, breaking an invariant.
This race condition could be triggered reliably by shutting down the
network (e.g., turning wifi off), closing the connection, and waiting
for the timeout. Then, close() calls close_socket() — this happens in
the `raise_close_exc` branch of send_context(). This unblocks the read
in recv_events() which calls close_socket() in the `finally:` branch.
Fix#1558.
0 commit comments