Signals don't reach the server process, so `docker stop` always waits for the timeout

Open
#2,188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, node.js, shell, typescript
Domain
backend, devops

Research direction

Start with docker-entrypoint.sh and the comment above its final command, then inspect server-lifecycle.ts:75-76 and docker-entrypoint.test.ts. Verify that the container’s server process becomes PID 1, signal handlers run during docker stop, and the test covers the entrypoint behavior.

Written by the indexing model from the issue text.

Description

infrastructure internal ready-for-agent reliability tech debt

Description

docker-entrypoint.sh ends with:

cd /graph-explorer/packages/graph-explorer-proxy-server && NODE_ENV=production node src/node-server.ts

No exec, so sh stays PID 1 and node runs as its child. Docker sends SIGTERM to PID 1 only, so sh gets it and node never does.

server-lifecycle.ts:75-76 registers handlers for both signals:

onSignal("SIGTERM", () => shutdown("SIGTERM"));
onSignal("SIGINT", () => shutdown("SIGINT"));

Those handlers have never run in a container. Every docker stop sits through the full 10-second grace period and then takes SIGKILL, so in-flight requests are cut rather than drained.

Expected

docker stop shuts down promptly and the graceful shutdown path runs.

Fix

Add exec to that last line. Note the comment directly above it, # Stubbed in tests — update docker-entrypoint.test.ts if changing, so the test needs updating too. Worth adding a case that asserts the server process is PID 1.

[!IMPORTANT]
Internal only — this issue is maintained by the core team and is not accepting external contributions.

Dominant language
TypeScript
Stars
481
Forks
110
Avg merge
2d 14h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/graph-explorer

All issues in aws/graph-explorer

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.