Skip to content

Correctly handle 400 status code response #2310

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

Merged
merged 1 commit into from
Oct 25, 2016

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Oct 7, 2016

When a ReindexOnServerResponse comes back as 400 status code, deserialize the response so that Failures is populated with more details for why things failed.

Use the -1 special case in AllowedStatusCodes in the dispatch call, similar to UpdateByQuery and DeleteByQuery; IsValid will still be false as it checks Failures which will be deserialized and not be empty. Success on ApiCallDetails will be true however.

Closes #2309

When a ReindexOnServerResponse comes back as 400 status code, deserialize the response so that Failures is populated with more details for why things failed. Use the -1 special case in AllowedStatusCodes in the dispatch call, similar to UpdateByQuery and DeleteByQuery; IsValid will still be false as it checks Failures which will be deserialized and not be empty. Success on ApiCallDetails will be true however.

Closes #2309
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

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

LGTM.

FYI I opened this ticket on core repos couple months back to discuss this behavior:

elastic/elasticsearch#17548

@gmarz
Copy link
Contributor

gmarz commented Oct 20, 2016

LGTM 👍

@gmarz gmarz merged commit a7ba8cc into 5.x Oct 25, 2016
@gmarz gmarz deleted the fix/5.x-reindex-on-server-failure branch October 25, 2016 14:32
gmarz pushed a commit that referenced this pull request Oct 25, 2016
When a ReindexOnServerResponse comes back as 400 status code, deserialize the response so that Failures is populated with more details for why things failed. Use the -1 special case in AllowedStatusCodes in the dispatch call, similar to UpdateByQuery and DeleteByQuery; IsValid will still be false as it checks Failures which will be deserialized and not be empty. Success on ApiCallDetails will be true however.

Closes #2309
gmarz pushed a commit that referenced this pull request Oct 25, 2016
When a ReindexOnServerResponse comes back as 400 status code, deserialize the response so that Failures is populated with more details for why things failed. Use the -1 special case in AllowedStatusCodes in the dispatch call, similar to UpdateByQuery and DeleteByQuery; IsValid will still be false as it checks Failures which will be deserialized and not be empty. Success on ApiCallDetails will be true however.

Closes #2309
@gmarz
Copy link
Contributor

gmarz commented Oct 25, 2016

Ported to 2.x 774da69
Ported to master 300e390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants