mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
lightningd: fix 100% CPU hang on shutdown.
This finally happened on my test box; tests simply stopped. Turns out we were spinning here, with waitpid returning -1. Since this is during shutdown, that also explains why pytest under CI would hang, since timeouts don't apply during test teardown! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
2c9b043be9
commit
6f17d8bf0c
@ -827,7 +827,7 @@ static struct io_plan *sigchld_rfd_in(struct io_conn *conn,
|
||||
int wstatus;
|
||||
|
||||
/* Reap the plugins, since we otherwise ignore them. */
|
||||
while ((childpid = waitpid(-1, &wstatus, WNOHANG)) != 0) {
|
||||
while ((childpid = waitpid(-1, &wstatus, WNOHANG)) > 0) {
|
||||
maybe_subd_child(ld, childpid, wstatus);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user