[issue30038] Race condition in how trip_signal writes to wakeup fd

Nathaniel Smith report at bugs.python.org
Wed May 17 01:43:27 EDT 2017


Nathaniel Smith added the comment:

> While I suggest you to *not* use an event loop (wakeup fd pipe/socket handle with select) and signal.signal(), you are true that there is a race condition if you use select() with signal.signal() so I merged your change.

Unfortunately this is the only 100% reliable way to do signal handling with an event loop so I guess you are unlikely to convince any of the projects that use it this way to change their minds :-)

> Do you consider that it's worth it to backport the change to 3.5 and 3.6?

I guess it'd be nice? At least for 3.6? I just had yet another random PR fail its tests due to this bug -- it's turning out to be quite difficult to make my tests reliable :-/. (BTW do you happen to know any tricks to force CPython to do an immediate PyErr_CheckSignals on Windows?)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30038>
_______________________________________


More information about the Python-bugs-list mailing list