Description
Today GET _cluster/health
returns 408 Request timeout
if it times out before the desired condition is reached. This response code is to indicate that the server timed out waiting for a request from the client, so it isn't appropriate here at all. There's no great fit for a server-side timeout response code, I suggest 503
.
This API already returns 503 Service unavailable
if there is no master, after waiting a while, but immediately returns 200 OK
if there is a master but STATE_NOT_RECOVERED_BLOCK
is in place. I think we should wait and return 503
in the presence of the STATE_NOT_RECOVERED_BLOCK
too.