Going to Production
What separates a server that runs from a service you can operate.
Going to Production
With every deployment, a handful of users see a network error. Not enough to trigger an alert, but enough to generate support tickets. The cause isn't in your business code: the orchestrator sends SIGTERM to the process, Node exits immediately, and every request being processed is cut off midway, including those that had already written to the database and never confirmed to the client. Five lines are enough to eliminate this symptom entirely, and most services don't have them.
The second gap between "it runs" and "it's operable" is observability. A service that doesn't expose a health probe distinct from its readiness probe receives traffic before it's ready. A service that logs in free-form sentences makes it impossible to find a given user's requests during an incident. A service whose container image runs its process as root gives any arbitrary code execution full control of the container. This final lesson covers these points in the order in which they'll cost you the most.
Graceful Shutdown
The goal: stop accepting new connections, let in-flight requests finish, close resources, then exit.
Comments
Comments are powered by GitHub Discussions
Sign in with GitHub to join the discussion