app icon indicating copy to clipboard operation
app copied to clipboard

Graceful shutdown

Open arberiii opened this issue 4 years ago • 4 comments

Closes #67. Note that mux.Server always shutdowns gracefully and for GRPC service, we can call the GracefulStop method.

arberiii avatar May 27 '20 21:05 arberiii

This is not enough. We need to extend the functionality and to allow developers to control what they want to process when receiving shutdown signal.

magicoder10 avatar May 27 '20 21:05 magicoder10

https://medium.com/honestbee-tw-engineer/gracefully-shutdown-in-go-http-server-5f5e6b83da5a

magicoder10 avatar May 27 '20 21:05 magicoder10

I will check it out, thank you!

arberiii avatar May 27 '20 22:05 arberiii

The intended behavior for graceful shutdown:

  1. Server stops accepting new requests
  2. Wait for all current requests to finish
  3. Clean up system resources
  4. Shutdown the server.

Need to think about how can we make this happen.

magicoder10 avatar Jun 27 '20 17:06 magicoder10