Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster allocation explain to never return empty response body #23054

Conversation

javanna
Copy link
Member

@javanna javanna commented Feb 8, 2017

Empty response bodies should only be sent back for HEAD requests, otherwise we should always send back info about the exception that was thrown. Removed some manual exception handling in the REST action that should be rather bubbled up and handled by our rest action infra like every other rest action does.

throw new ElasticsearchParseException("'index', 'shard', and 'primary' must be specified in allocation explain request", e);
}
return req;
return PARSER.parse(parser, new ClusterAllocationExplainRequest(), null);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why we were validating the request manually here. Validation is part of the transport action execution. Removing it doesn't cause any test failure.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe its necessary, ++ for taking it out

@javanna
Copy link
Member Author

javanna commented Feb 8, 2017

@abeyad @dakrone can either of you have a look please?

Copy link

@abeyad abeyad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @javanna

throw new ElasticsearchParseException("'index', 'shard', and 'primary' must be specified in allocation explain request", e);
}
return req;
return PARSER.parse(parser, new ClusterAllocationExplainRequest(), null);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe its necessary, ++ for taking it out

@javanna javanna added the v5.4.0 label Feb 8, 2017
@javanna
Copy link
Member Author

javanna commented Feb 9, 2017

retest this please

Empty response bodies should only be sent for HEAD requests, otherwise we should always send back info about the exception that was thrown. Removed some manual exception handling in the REST action that should be rather bubbled up and handled by our rest action infra like every other rest action does.
@javanna javanna force-pushed the enhancement/cluster_allocation_explain_empty_body branch from d907f16 to da2fcb8 Compare February 9, 2017 16:11
@javanna javanna merged commit 90ea778 into elastic:master Feb 9, 2017
javanna added a commit to javanna/elasticsearch that referenced this pull request Feb 9, 2017
…ic#23054)

Empty response bodies should only be sent for HEAD requests, otherwise we should always send back info about the exception that was thrown. Removed some manual exception handling in the REST action that should be rather bubbled up and handled by our rest action infra like every other rest action does.
javanna added a commit to javanna/elasticsearch that referenced this pull request Feb 9, 2017
…ic#23054)

Empty response bodies should only be sent for HEAD requests, otherwise we should always send back info about the exception that was thrown. Removed some manual exception handling in the REST action that should be rather bubbled up and handled by our rest action infra like every other rest action does.
javanna added a commit that referenced this pull request Feb 9, 2017
Empty response bodies should only be sent for HEAD requests, otherwise we should always send back info about the exception that was thrown. Removed some manual exception handling in the REST action that should be rather bubbled up and handled by our rest action infra like every other rest action does.
javanna added a commit that referenced this pull request Feb 9, 2017
Empty response bodies should only be sent for HEAD requests, otherwise we should always send back info about the exception that was thrown. Removed some manual exception handling in the REST action that should be rather bubbled up and handled by our rest action infra like every other rest action does.
javanna added a commit that referenced this pull request Feb 9, 2017
Empty response bodies should only be sent for HEAD requests, otherwise we should always send back info about the exception that was thrown. Removed some manual exception handling in the REST action that should be rather bubbled up and handled by our rest action infra like every other rest action does.
@clintongormley clintongormley added :Distributed Indexing/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. and removed :Cluster labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Indexing/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. v5.2.2 v5.3.0 v5.4.0 v6.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants