Charles-François Natali added the comment: > Guido van Rossum added the comment: > > Actually, I think we're talking about the actual select() syscal not > returning when SIGCHLD is received and handled. Running the C-level handler > isn't enough, the syscall must return with EINTR so the Python handler can > run (which then writes a byte to the self-pipe to ensure select() returns, > but that seems too late). Maybe twiddling with SA_RESTART can fix this?
Hum, I just check asyncio's code, and it's not doing what I thought it was doing. SA_RESTART won't help: PyOS_setsig() already doesn't set it, and also calls siginterrupt() to ensure the syscall will be interrupted, but as can been seen here, that's not portable. The correct way to do this, IMO, would be to simply change BaseSelectorEventLoop._read_from_self() to read the signal number from the wakeup FD (Python's signal handler writes the signal number to this FD): then, we could call directly call the relevant signal handler. This way, this would succeed even if select()/poll()/whatever doesn't fail with EINTR (it'll also be a bit simpler/faster). I thought that's how it was done in tulip! ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19293> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com