fix: Reinstate blanket error handling in event loop

Fixes #534
This commit is contained in:
Karolin Varner
2024-12-14 15:25:03 +01:00
parent 97dff8453d
commit c0b91fd729
3 changed files with 84 additions and 83 deletions

View File

@@ -35,8 +35,15 @@ impl Drop for KillChild {
fn drop(&mut self) {
use rustix::process::{kill_process, Pid, Signal::Term};
let pid = Pid::from_child(&self.0);
rustix::process::kill_process(pid, Term).discard_result();
self.0.wait().discard_result();
// We seriously need to start handling signals with signalfd, our current signal handling
// system is a bit broken; there is probably a few functions that just restart on EINTR
// so the signal is absorbed
loop {
rustix::process::kill_process(pid, Term).discard_result();
if self.0.try_wait().unwrap().is_some() {
break;
}
}
}
}