Graceful shutdown
A coordinated stop where a process handles a shutdown request, finishes or safely aborts work, releases resources, and exits cleanly.
Definition
A graceful shutdown is when a process cooperates with a shutdown request (often via signal) and exits cleanly after doing whatever cleanup is necessary.
Typical steps include:
- stop accepting new work
- finish or safely abort in-flight work
- flush buffers and logs
- close connections
- exit with a clear exit code
Graceful shutdown reduces data loss and inconsistent state compared to forced termination.