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

Small tidy-up in TaskCancellationService #92795

Merged

Conversation

DaveCTurner
Copy link
Contributor

We use a fixed-size CountDownActionListener here to wait for each of 3 actions to complete, but two of the three actions cannot fail and the result completes a StepListener so we can just use a RefCountingRunnable instead.

Also we can just use StepListener#addListener a little further down instead of passing the same runnable in two different arguments.

We use a fixed-size `CountDownActionListener` here to wait for each of 3
actions to complete, but two of the three actions cannot fail and the
result completes a `StepListener` so we can just use a
`RefCountingRunnable` instead.

Also we can just use `StepListener#addListener` a little further down
instead of passing the same runnable in two different arguments.
@DaveCTurner DaveCTurner added :Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. >refactoring v8.7.0 labels Jan 10, 2023
@DaveCTurner DaveCTurner requested a review from kingherc January 10, 2023 17:12
@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jan 10, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Copy link
Contributor

@kingherc kingherc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DaveCTurner DaveCTurner merged commit f77ce8b into elastic:main Jan 11, 2023
@DaveCTurner DaveCTurner deleted the 2023-01-10-TaskCancellationService-tidy branch January 11, 2023 17:52
danielmitterdorfer pushed a commit to danielmitterdorfer/elasticsearch that referenced this pull request Jan 12, 2023
We use a fixed-size `CountDownActionListener` here to wait for each of 3
actions to complete, but two of the three actions cannot fail and the
result completes a `StepListener` so we can just use a
`RefCountingRunnable` instead.

Also we can just use `StepListener#addListener` a little further down
instead of passing the same runnable in two different arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. >refactoring Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants