[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

Fantix King report at bugs.python.org
Sat May 9 18:52:06 EDT 2020


Fantix King <fantix.king at gmail.com> added the comment:

Following the discussion - looks like `add_reader()` will cancel the previous `handle` on the same `fd` if found, so I think it is reasonable to solve this cancellation-race issue by checking if the `handle` is cancelled as shown in the attached patch (tests in uvloop passed with this patch). WDTY?

----------
nosy: +fantix
Added file: https://bugs.python.org/file49146/cancelled-sock-recv-race.patch

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30064>
_______________________________________


More information about the Python-bugs-list mailing list