Skip to content

Graceful connection close without sending a `QUIT` command first

Fabian Fett requested to merge ff-graceful-shutdown-without-close-cmd into master

Motivation

The redis documentation mentions in the QUIT command:

Note: Clients should not use this command. Instead, clients should simply close the connection when they're not used anymore. Terminating a connection on the client side is preferable, as it eliminates TIME_WAIT lingering sockets on the server side.

https://redis.io/commands/quit/

Changes

  • Do not send the QUIT command before closing anymore
  • Introduce a draining state in RedisCommandHandler
    • If the RedisCommandHandler is in state draining new request are failed immediately
    • Once all running requests are finished, the channel is closed

Merge request reports