Guido van Rossum added the comment: Justin's repro provides a clue: when the event loop is stopped before all callbacks have been processed, when the loop is restarted the I/O selector is asked again to do its work, and it will report all the same sockets as ready. So then the callback will be put into the ready queue again (even though it's already there). Then the second call will find the future already done.
I'm not sure how this explains Alexander's issue but it's probably something similar. We should carefully review the other I/O callbacks too -- most of them look like they don't mind being called spuriously, but there are a few others (_sock_recv, _sock_sendall, _sock_accept) that look like they check for fut.cancelled() and might be susceptible to the same bug. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25593> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com