You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found a bug in function daemon_start from libdaemon/server/daemon-server.c. It may occur in daemons like lvmetad, lvmlockd, lvmpolld.
In stable-2.02 branch, if we use the daemon lvmetad without -t option. when lvmetad is running a sub process, if the daemon recieve a SIGTERM from systemd. _shutdown_requested will turn to 1, s.threads->next is not NULL, then the while loop could not break, in the next loop, select will be blocked. Sometimes, it will lead to timeout of shutdown machine.
It could be reproduced following the steps:
1.run process 1 like,
while :
do
lvs
done
2.run process 2 like,
while :
do
service lvm2-lvmetad stop
if [ $? -ne 0 ];then
echo "fail to stop"
break
fi
sleep 2
done
3.soon, process 2 will be blocked, then press "CTRL+C" to stop process 1, we will see process still blocke there. Using gdb attach to lvm2-lvmetad daemon, we will see, lvm2-lvmetad blocket in select function of daemon_start. Although, at this time, _shutdown_requested is 1, s.threads->next is NULL(the _client_thread thread has already quit).
This does not look as a correct solution - but rather a race 'shift' to lower the chances to hit it - but IMHO it should be handled properly with pselect(). - I'll take a look if there is an easy way to provide correct patch.
Found a bug in function daemon_start from libdaemon/server/daemon-server.c. It may occur in daemons like lvmetad, lvmlockd, lvmpolld.
In stable-2.02 branch, if we use the daemon lvmetad without -t option. when lvmetad is running a sub process, if the daemon recieve a SIGTERM from systemd. _shutdown_requested will turn to 1, s.threads->next is not NULL, then the while loop could not break, in the next loop, select will be blocked. Sometimes, it will lead to timeout of shutdown machine.
It could be reproduced following the steps:
1.run process 1 like,
2.run process 2 like,
3.soon, process 2 will be blocked, then press "CTRL+C" to stop process 1, we will see process still blocke there. Using gdb attach to lvm2-lvmetad daemon, we will see, lvm2-lvmetad blocket in select function of daemon_start. Although, at this time, _shutdown_requested is 1, s.threads->next is NULL(the _client_thread thread has already quit).
Suggested patch:
The text was updated successfully, but these errors were encountered: