Fix: sessiond: occasional badfd error on repeated SIGTERM
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Mar 2020 21:52:32 +0000 (16:52 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 6 Apr 2020 16:33:52 +0000 (12:33 -0400)
commit8ea7fcf08b5012f42e1b204e8d28cc6df418e779
tree0dad87f7f5887a9d489c5f936280bc2ec4f953f4
parent7f9bbb9186ad8c7efc7209c44dd1689a338c63dc
Fix: sessiond: occasional badfd error on repeated SIGTERM

The session daemon occasionally prints the following messages
when it received multiple SIGTERM signals:

PERROR - 16:50:18.505585257 [49845/49845]: write poll pipe: Bad file
descriptor (in notify_thread_pipe() at utils.c:35)

This is caused by a (somewhat inevitable) race between the teardown of
the daemon and the closing of its quit pipe. This happens more often
when kernel modules take a long time to be unloaded and the user
spams ctrl+c in the hope of convincing the daemon process to close
faster since modules are unloaded after closing the quit pipe.

Setting closed pipe fds to '-1' is safe anyway and is already
handled by the notify_thread_pipe() util.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: If08a455c65055dcb56ffbad3703173e6a45cfba5
src/common/utils.c
This page took 0.025813 seconds and 4 git commands to generate.