-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fail to stop daemon-server #16
Comments
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. |
Already fixed upstream with 44cfa55 and few follow up patches. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: