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.
Today
GET _cluster/healthreturns408 Request timeoutif 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 suggest503.This API already returns
503 Service unavailableif there is no master, after waiting a while, but immediately returns200 OKif there is a master butSTATE_NOT_RECOVERED_BLOCKis in place. I think we should wait and return503in the presence of theSTATE_NOT_RECOVERED_BLOCKtoo.