-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Hi. First: Very neat crate! Makes my code much better readable than while-looping and waiting.
I ran into an issue relating to the SIGCHLD handler that is installed, but not removed. TL;DR: any code that uses syscalls and that does not explicitly handle std::io::ErrorKind::Interrupted is liable to blow up in your face (for a POC see here).
I understand that this crate works with global state and aims to install the handler only once, reusing it afterwards to support async execution. That makes of course sense, however an interface to restore the default signal handler at least manually would be great. This would also surface that it is required to do so, in case you plan on executing any syscalls yourself.
Currently the documentation mentions:
[..] The current implementation registers a
SIGCHLDhandler and initializes some global state. This handler also works within multi-threaded environments. If your application is otherwise handlingSIGCHLDthen bugs may arise.
Alternative to adding the "uninstall interface" make it really clear that you must handle interruptions yourself (alas that was not clear to me).