mirror of https://github.com/peter4431/rq.git
Workaround for os.waitpid() throwing an OSError on SIGINT.
When SIGINT (``Ctrl+C``) is received when inside a blocking os.waitpid(), OSError is thrown, effectively cancelling the wait. However, to facilitate a "warm shutdown", as we intend, Ctrl+C is perfectly allowed and we want to keep waiting for the child. Therefore, we perform a trick here, catching OSError, checking whether its cause was SIGINT (errno == EINTR), and only in that case, loop to os.waitpid() again.main
parent
e278bd2967
commit
1cbf92c166
Loading…
Reference in New Issue