Graceful Shutdown in Go: Practical Patterns
Graceful Shutdown in Go: Practical PatternsGraceful shutdown in any application generally satisfies three minimum conditions:Close the entry point by stopping new requests or messages from sources like HTTP, pub/sub systems, etc. However, keep outgoing connections to third-party services like databases or caches active.Wait for all ongoing requests to finish. If a request takes too long, respond with a graceful error.Release critical resources such as database connections, file locks, or network...
Read more at victoriametrics.com