Message379220
Here's a simple test case that fails on the main branch.
https://github.com/sourcejedi/cpython/commit/50184ea3b354fd775866d036ccee058ec6734927
> the patch assumes that python signal handler will be called *before* reading from self-pipe.
> Otherwise, a signal callback will be postponed up to next writing to the pipe, which looks like a hidden bug.
I think it will be? I can imagine it being a concern for future changes though. I thought it could break if anyone takes seriously the comment "XXX Signals should be recorded per thread, now we have thread state." :-).
But if we're not confident, surely all we have to do is make sure to call _write_to_self() at the end of the python signal handler (_UnixSelectorEventLoop._sig_handler()).
It seems a pity not to have example code we can point to, that handles signals correctly. Even if it's too tedious to explain the correct way in the official docs. |
|
Date |
User |
Action |
Args |
2020-10-21 16:43:27 | sourcejedi | set | recipients:
+ sourcejedi, vstinner, njs, asvetlov, yselivanov |
2020-10-21 16:43:27 | sourcejedi | set | messageid: <1603298607.16.0.804931248036.issue35749@roundup.psfhosted.org> |
2020-10-21 16:43:27 | sourcejedi | link | issue35749 messages |
2020-10-21 16:43:27 | sourcejedi | create | |
|