When a query is interrupted by a server shutdown, it won't get retried as it appears to the router like any normal error (e.g. a syntax error). This can be worked around by putting the server first into maintenance mode and then shutting the server down.
One way of dealing with this is to inspect the returned packet in RWBackend::process_reply and store the error type. If the correct error is found a fake hangup event on the DCB could be created and the normal error handling would take care of the retrying.