Add get file chunk timeouts with listener timeouts#38758
Merged
Tim-Brooks merged 4 commits intoelastic:masterfrom Feb 13, 2019
Merged
Add get file chunk timeouts with listener timeouts#38758Tim-Brooks merged 4 commits intoelastic:masterfrom
Tim-Brooks merged 4 commits intoelastic:masterfrom
Conversation
Collaborator
|
Pinging @elastic/es-distributed |
ywelsch
reviewed
Feb 12, 2019
Contributor
ywelsch
left a comment
There was a problem hiding this comment.
Left a few nits, looking good o.w.
server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java
Show resolved
Hide resolved
| ActionListener<Void> listener = wrap(completed, exception); | ||
|
|
||
| ActionListener<Void> wrapped = ListenerTimeouts.wrapWithTimeout(taskQueue.getThreadPool(), listener, timeout, "test"); | ||
| wrapped.onResponse(null); |
Contributor
There was a problem hiding this comment.
check same thing for exception
server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/support/ListenerTimeouts.java
Outdated
Show resolved
Hide resolved
ywelsch
approved these changes
Feb 13, 2019
| @Override | ||
| public void onResponse(Void aVoid) { | ||
| assert completed.get() == false : "Should not be called twice"; | ||
| completed.set(true); |
Contributor
There was a problem hiding this comment.
write assertTrue(compareAndSet(false, true)) instead?
| @Override | ||
| public void onFailure(Exception e) { | ||
| assert exception.get() == null : "Should not be called twice"; | ||
| exception.set(e); |
Contributor
There was a problem hiding this comment.
same here, use assertTrue(compareAndSet(false, true)) to also check that only one of onResponse / onFailure is called
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Feb 13, 2019
* master: Fix excessive increments in soft delete policy (elastic#38813) Perform precise check for types warnings in cluster restart tests. (elastic#37944) [ML] Extract base class for integ tests with native processes (elastic#38850) Add get file chunk timeouts with listener timeouts (elastic#38758) Fix PreConfiguredTokenFilters getSynonymFilter() implementations (elastic#38839)
Tim-Brooks
added a commit
that referenced
this pull request
Feb 16, 2019
This commit adds a `ListenerTimeouts` class that will wrap a `ActionListener` in a listener with a timeout scheduled on the generic thread pool. If the timeout expires before the listener is completed, `onFailure` will be called with an `ElasticsearchTimeoutException`. Timeouts for the get ccr file chunk action are implemented using this functionality. Additionally, this commit attempts to fix #38027 by also blocking proxied get ccr file chunk actions. This test being un-muted is useful to verify the timeout functionality.
Tim-Brooks
added a commit
that referenced
this pull request
Feb 16, 2019
This commit adds a `ListenerTimeouts` class that will wrap a `ActionListener` in a listener with a timeout scheduled on the generic thread pool. If the timeout expires before the listener is completed, `onFailure` will be called with an `ElasticsearchTimeoutException`. Timeouts for the get ccr file chunk action are implemented using this functionality. Additionally, this commit attempts to fix #38027 by also blocking proxied get ccr file chunk actions. This test being un-muted is useful to verify the timeout functionality.
Tim-Brooks
added a commit
that referenced
this pull request
Feb 16, 2019
This commit adds a `ListenerTimeouts` class that will wrap a `ActionListener` in a listener with a timeout scheduled on the generic thread pool. If the timeout expires before the listener is completed, `onFailure` will be called with an `ElasticsearchTimeoutException`. Timeouts for the get ccr file chunk action are implemented using this functionality. Additionally, this commit attempts to fix #38027 by also blocking proxied get ccr file chunk actions. This test being un-muted is useful to verify the timeout functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds a
ListenerTimeoutsclass that will wrap aActionListenerin a listener with a timeout scheduled on the genericthread pool. If the timeout expires before the listener is completed,
onFailurewill be called with anElasticsearchTimeoutException.Timeouts for the get ccr file chunk action are implemented using this
functionality. Additionally, this commit attempts to fix #38027 by also
blocking proxied get ccr file chunk actions. This test being un-muted is
useful to verify the timeout functionality.