Skip to content

5.0.0-beta1 ReindexOnServerResponse needs to also check response status for IsValid #2309

@niemyjski

Description

@niemyjski

screen shot 2016-10-07 at 11 36 00 am

Currently IsValid only checks the bulk response failures so if the request to the server is invalid. The response status will be incorrect :)

Valid NEST response built from a unsuccessful low level call on POST: /_reindex
# Audit trail of this API call:
 - [1] BadResponse: Node: http://localhost:9200/ Took: 00:00:00.0780609
# OriginalException: System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Elasticsearch.Net.HttpConnection.<RequestAsync>d__7`1.MoveNext() in C:\code\elasticsearch-net\src\Elasticsearch.Net\Connection\HttpConnection.cs:line 179
# Request:
{"source":{"sort":[{"id":{"order":"asc"}}],"index":"employees-v1"},"dest":{"index":"employees-v2"},"conflicts":"proceed"}
# Response:
{"took":4,"timed_out":false,"total":1,"updated":0,"created":0,"deleted":0,"batches":1,"version_conflicts":0,"noops":0,"retries":{"bulk":0,"search":0},"throttled_millis":0,"requests_per_second":-1.0,"throttled_until_millis":0,"failures":[{"index":"employees-v2","type":"employee","id":"57f7ce8df8a10336a0cf935b","cause":{"type":"mapper_parsing_exception","reason":"failed to parse [id]","caused_by":{"type":"number_format_exception","reason":"For input string: \"57f7ce8df8a10336a0cf935b\""}},"status":400}]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions