don't return 503 on RED cluster health, since we managed to handle the request, use "/" to check the status of the node (as a load balancer ping for example)

This commit is contained in:
Shay Banon 2012-02-26 17:36:18 +02:00
parent 6232ce1dd4
commit b6227f24c1
1 changed files with 5 additions and 3 deletions

View File

@ -87,9 +87,11 @@ public class RestClusterHealthAction extends BaseRestHandler {
public void onResponse(ClusterHealthResponse response) {
try {
RestStatus status = RestStatus.OK;
if (response.status() == ClusterHealthStatus.RED) {
status = RestStatus.SERVICE_UNAVAILABLE;
}
// not sure..., we handle the health API, so we are not unavailable
// in any case, "/" should be used for
//if (response.status() == ClusterHealthStatus.RED) {
// status = RestStatus.SERVICE_UNAVAILABLE;
//}
XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
builder.startObject();