-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Add get file chunk timeouts with listener timeouts #38758
Conversation
Pinging @elastic/es-distributed |
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.
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); |
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.
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
@Override | ||
public void onResponse(Void aVoid) { | ||
assert completed.get() == false : "Should not be called twice"; | ||
completed.set(true); |
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.
write assertTrue(compareAndSet(false, true))
instead?
@Override | ||
public void onFailure(Exception e) { | ||
assert exception.get() == null : "Should not be called twice"; | ||
exception.set(e); |
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.
same here, use assertTrue(compareAndSet(false, true))
to also check that only one of onResponse / onFailure is called
* 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)
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 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 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 commit adds a
ListenerTimeouts
class that will wrap aActionListener
in a listener with a timeout scheduled on the genericthread pool. If the timeout expires before the listener is completed,
onFailure
will 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.