-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Honor update request timeout #23825
Honor update request timeout #23825
Conversation
When executing an update request, the request timeout is not transferred to the index/delete request executed on behalf of the update request. This leads to update requests not timing out when they should (e.g., if not all shards are available when the request specifies wait_for_shards=all with a small timeout). This commit causes the index/delete requests to honor the update request timeout.
83863b1
to
fc228fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
I think the upsert case has the same problem.
@@ -307,12 +338,12 @@ public void testNowInScript() throws IOException { | |||
Streamable action = result.action(); | |||
assertThat(action, instanceOf(IndexRequest.class)); | |||
IndexRequest indexAction = (IndexRequest) action; | |||
assertEquals(indexAction.sourceAsMap().get("update_timestamp"), nowInMillis); | |||
assertEquals(nowInMillis, indexAction.sourceAsMap().get("update_timestamp")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
} | ||
} | ||
|
||
private Script mockInlineScript(final String script) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we think this makes things more readable we should probably add it as a static method on MockScriptEngine
and statically import it in the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed f970908.
ESTestCase::randomNonNegativeLong); | ||
final Streamable action = result.action(); | ||
if (delete) { | ||
assertThat(action, instanceOf(DeleteRequest.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to prefer letting the test throw the ClassCastException rather than asserting this first.
It should be handled by the index case but I'll add a test to be sure. |
You were right, there was a case missing. I pushed 58b4d8c. |
When executing an update request, the request timeout is not transferred to the index/delete request executed on behalf of the update request. This leads to update requests not timing out when they should (e.g., if not all shards are available when the request specifies wait_for_shards=all with a small timeout). This commit causes the index/delete requests to honor the update request timeout. Relates #23825
When executing an update request, the request timeout is not transferred to the index/delete request executed on behalf of the update request. This leads to update requests not timing out when they should (e.g., if not all shards are available when the request specifies wait_for_shards=all with a small timeout). This commit causes the index/delete requests to honor the update request timeout. Relates #23825
Thank you @nik9000. |
LGTM2 (albeit too late to count) |
Your thoughts are never too late to count, thank you for looking. |
Would be doable to push this to 2.x as well? |
This is not a critical bug and not a regression, I think that we will not be backporting this one. |
+1 to not backporting to 2.4
… On 31 Mar 2017, at 3:22 PM, Jason Tedor ***@***.***> wrote:
This is not a critical bug and not a regression, I think that we will not be backporting this one.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
When executing an update request, the request timeout is not transferred to the index/delete request executed on behalf of the update request. This leads to update requests not timing out when they should (e.g., if not all shards are available when the request specifies wait_for_shards=all with a small timeout). This commit causes the index/delete requests to honor the update request timeout.