Skip to content
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

Feature request: support clean shutdown also on SIGTERM #736

Open
rwalkerands opened this issue Feb 19, 2024 · 2 comments
Open

Feature request: support clean shutdown also on SIGTERM #736

rwalkerands opened this issue Feb 19, 2024 · 2 comments
Labels

Comments

@rwalkerands
Copy link

docker/podman stop script-server sends first SIGTERM, then, after a timeout, SIGKILL.

script-server seems to ignore SIGTERM, so docker/podman sends SIGKILL after the timeout.

I see that ./src/web/server.py/intercept_stop_when_running_scripts() configures a handler for SIGINT that will do a clean shutdown as long as there are no currently-running scripts.

Would it be possible to do a clean shutdown on SIGTERM also? It could be like the existing behaviour for SIGINT except (I guess) acting as though the user answered n to the question Do you want to stop server anyway?.

@bugy
Copy link
Owner

bugy commented Feb 20, 2024

Hi @rwalkerands, thanks for reporting. I'm not sure what is the problem. In my understanding, SIGINT is needed for script server only to ask confirmation from a user.
If such confirmation is not needed, a signal (SIGTERM) should be propagated to all children processes. So that it's the responsibility of the children processes to handle SIGTERM properly.
Could you confirm, that if there are no running scripts, Script server stops on SIGTERM? Or you mean, that even in this case, SIGTERM is ignored?

@bugy bugy added the bug label Feb 20, 2024
@rwalkerands
Copy link
Author

I'm getting this:

$ podman stop script-server
WARN[0010] StopSignal SIGTERM failed to stop container script-server in 10 seconds, resorting to SIGKILL
script-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants