-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Hi,
We've noticed that our cache server containers are always terminating with a 'Timeout reached for graceful shutdown. Forcing exit.' message 30 seconds after the shutdown. To reproduce:
docker run -e API_BASE_URL=http://localhost:3000 --rm ghcr.io/falcondev-oss/github-actions-cache-server
and hit ctrl+c.
I found out that I can influence the timeout period with the NITRO_SHUTDOWN_TIMEOUT env var but increasing it didn't help. It also happens when no request whatsoever hit the container between startup and shutdown.
Checking within the running container, I see two processes:
/app $ ps
PID USER TIME COMMAND
1 node 0:01 node /app/server/index.mjs
18 node 0:01 /usr/local/bin/node /app/server/index.mjs
When I'm sending a SIGTERM from within the container to PID 1, it doesn't seem to get propagated to the cluster worker in the second process (here 18), keeping the main process 1 waiting.
If I send SIGTERM to PID 1 and then another SIGTERM to the second process, it shuts down right away without the error.