Production server doesn't handle SIGTERM
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- kubernetes, node.js, typescript
Research direction
Find the startProdServer implementation and trace how it returns the server; compare it with the signal handling in next start and the standalone server.js mentioned in the issue. Add SIGTERM and SIGINT handling that closes the returned server and lets in-flight requests finish. Confirm both signals trigger graceful shutdown without dropping active requests.
Written by the indexing model from the issue text.
Description
next start and Next's standalone server.js close the server on SIGTERM/SIGINT and let in-flight requests finish. startProdServer doesn't register any signal handlers, so on Kubernetes Node either dies right away and drops in-flight requests, or, running as PID 1, ignores SIGTERM until it's SIGKILLed at the end of the grace period.
We work around it with our own entry that calls startProdServer and closes the returned server on both signals. Would be nice to have it built in like Next.
- Dominant language
- TypeScript
- Stars
- 9.3k
- Forks
- 463
- Avg merge
- 22h 22m
- Merged PRs (30d)
- 502
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/vinext
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
cloudflare/vinext#4592 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
cloudflare/vinext#4591 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
cloudflare/vinext#4589 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
cloudflare/vinext#4586 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
cloudflare/vinext#4585 ·
Maintainers usually reply within 1 day
All issues in cloudflare/vinext
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
binding:python bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
coollabsio/orbit#72 ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
bug needs-triage potential-regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aws/aws-sdk-js-v3#8408 ·
Maintainers usually reply within 1 day