Grokking Concurrency in Go
0% completed
Graceful Shutdown with Signals
What happens to a request that is halfway through its work when someone presses Ctrl+C, or when a deployment replaces the running process with a new version? Unless the program handles the stop request itself, the request ends unfinished. The process exits at once, deferred functions do not run, and buffered data that was never written is lost.
The operating system asks a process to stop by sending it a small numbered notification (a signal). Two signals matter for shutdown. SIGINT is sent when a user presses Ctrl+C in a terminal, and Go names it os.Interrupt. `SIGTERM
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%