-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Hydrus doesn't exit gracefully when stopping the docker container #1601
Comments
Thank you for this report. I am sorry I am late getting to it. I have had a good look at my shutdown code, and I might have fixed this for v594. I am very ignorant about how Docker works, and how the hydrus Docker package works, but it looks like Docker tries to shut the client process down with SIGTERM, and that is coming back two seconds later with exit status 1 (i.e. something went wrong during the shutdown). I suspect my SIGTERM exit was touching something from the wrong thread. I don't have a Docker instance (or expertise) to test this properly, and my dev machine is Windows, where SIGTERM is a whole different kettle of fish, so we may need to do a couple of rounds of back-and-forth to fully nail this down. In any case, I have cleaned up how I handle a SIGTERM to ensure it tries to shut things down as quickly as possible while still saving and cleaning everything it can, and handling the different thread interactions properly, and I cleaned some of my shutdown code generally. Please let me know how v594 goes for you, and if it does not, please check out the client log in
There are also some new 'self-sigterm' calls under I didn't know you couldn't nicely just go |
Thanks for getting back to me. I am sorry for my late response as well. I tried v594 and v596 and it does shutdown correctly when I SIGTERM from the container's shell with
and it doesn't restart hydrusclient when I use
but it doesn't work when I shutdown from docker
docker docs say I don't know if switching to another minimal init system will fix it, but some of them have signal forwarding to their children processes.
I think this is special case since most containers I checked only had a single process that could accept the SIGTERM directly from docker since it was PID1 Or they used tini init, from the quick reading I did it seems it can only control one process directly (this is probably wrong), but I think it could be configured to run a process group, and pass down the signal to the process group as a whole, but I haven't looked into it much. I think using tini as PID 1 and supervisord as the child process of tini (since supervisord doesn't behave well when its PID 1 also not sure about this but I read it somewhere), this will also be the easiest to implement since it doesn't need changing much, but I don't know if it would work. Its also implemented in docker so you can use it with just |
Hydrus version
v591
Qt major version
Qt 6
Operating system
Linux (specify distro and version in comments)
Install method
Third party (AUR, Docker, Chocolatey, etc. Specify in comments)
Install and OS comments
Host is a Debian 12 headless server
Using the docker image of hydrusclient
Bug description and reproduction
When stopping Hydrus from docker it always exits incorrectly, and on the next Hydrus boot it says
Found and deleted the durable temporary database on boot. The last exit was probably not clean.
in the logs.And the client does that popup that says do you want to restore last session
So to exit correctly i have to exit the client from the GUI and then stop it from docker quickly before the supervisor restarts Hydrus again.
I also tried increasing the grace time in docker compose
stop_grace_period: 120s
, but that didn't work.My server is pretty weak so at first i thought it just didn't save the db and close the client fast enough, but I don't think the client is even getting a signal to start turning off.
Also thank you for your amazing work, Hydrus is amazing
Log output
The text was updated successfully, but these errors were encountered: