Hi,
We've been developing various servers using Redis protocol and have been using a minor protocol extension that might be useful for core redis as well.
Essentially at the beginning of a graceful shutdown before each connection is closed we write "-GOAWAY\r\n" as a final message (essentially a GOAWAY error to a request that was never sent.) On receipt of this error message our clients automatically reconnect and resend any commands from the request that received the GOAWAY error onwards. This is safe since we know that the server did not process any of those requests.
Unfortunately this is a break in protocol but is safe to be implemented in clients first, and left as a default off option in the redis server.
In the current version of the client the responses are a little confusing, but could easily be improved if `redis-cli` had built-in support for the message:
127.0.0.1:8888> GET x
(nil)
127.0.0.1:8888> SHUTDOWN
OK
127.0.0.1:8888> GET X
(error) GOAWAY
127.0.0.1:8888> GET X
not connected> GET X
(nil)
127.0.0.1:8888>
Thanks,
Josh