Menu

1 / 2

How to Shut Down a Node.js API Without Dropping Requests

#sitepoint#process#node#code#shutdown
Long article (2412 words) — no AI summary yet.
Reading 0:00
15s threshold

Community Article

Community articles are authored by SitePoint Premium contributors. Content is screened before publication, and SitePoint reserves the right to moderate or remove articles that violate our guidelines. Views expressed are those of the authors and do not necessarily reflect those of SitePoint.

The AI briefing for Developers

Stay up to date with AI tools, model releases, and developer workflows that matter.

Weekly. Free. One click to leave.

Every deploy, autoscaling event and node drain ends the same way for a running Node.js process: the platform sends it SIGTERM and waits. What happens next decides whether your users notice the deploy.

If the process has no handler for that signal, it exits on the spot. Any request that was halfway through, say a report that takes three seconds of database work, never gets a response.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.