Skip to content
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

Merged
merged 4 commits into from
Feb 13, 2019

Conversation

Tim-Brooks
Copy link
Contributor

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 Tim-Brooks added >non-issue :Distributed/CCR Issues around the Cross Cluster State Replication features v6.7.0 v8.0.0 v7.2.0 v7.0.0-beta1 labels Feb 12, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

Copy link
Contributor

@ywelsch ywelsch left a 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.

ActionListener<Void> listener = wrap(completed, exception);

ActionListener<Void> wrapped = ListenerTimeouts.wrapWithTimeout(taskQueue.getThreadPool(), listener, timeout, "test");
wrapped.onResponse(null);
Copy link
Contributor

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

@Override
public void onResponse(Void aVoid) {
assert completed.get() == false : "Should not be called twice";
completed.set(true);
Copy link
Contributor

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);
Copy link
Contributor

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

@Tim-Brooks Tim-Brooks merged commit 07fd261 into elastic:master Feb 13, 2019
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.
@Tim-Brooks Tim-Brooks deleted the application_timeouts branch December 18, 2019 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/CCR Issues around the Cross Cluster State Replication features >non-issue v6.7.0 v7.0.0-beta1 v7.2.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CcrRepositoryIT.testIndividualActionsTimeout failing
4 participants