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

Add support for graceful shutdown on SIGINT and SIGTERM #52

Open
RFHold opened this issue Mar 30, 2024 · 2 comments · May be fixed by #69
Open

Add support for graceful shutdown on SIGINT and SIGTERM #52

RFHold opened this issue Mar 30, 2024 · 2 comments · May be fixed by #69

Comments

@RFHold
Copy link

RFHold commented Mar 30, 2024

Currently on Mac and Docker, the only way for me to shut down the running server is to manually kill the process. This is not ideal for production environments. This feature was added to adapter-node with this issue sveltejs/kit#9540

@gornostay25
Copy link
Owner

@RFHold yeah its a good point

@AmrSaber AmrSaber linked a pull request Oct 11, 2024 that will close this issue
@AmrSaber
Copy link

AmrSaber commented Oct 12, 2024

This is causing me problems with docker, as the container will totally ignore docker's stop signal. Docker always sends a SIGINT signal then wait 30s before killing the container.

This causes me 2 issues:

  1. Stopping the container is slow, as I always need to wait 30s until docker kills the container.
  2. I don't get any graceful shutdown, as any in-progress request is killed when the process itself is killed.

I created PR #69 to handle system signals, @gornostay25 please review and merge.

Edit:
For anyone with the same problem, I currently solve this problem with STOPSIGNAL SIGKILL at the end of my Dockerfile, this tells docker to send a SIGKILL directly and skip the 30s wait.

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

Successfully merging a pull request may close this issue.

3 participants