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 CooldownEsThreadPoolExecutor #47522

Closed
wants to merge 1 commit into from

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Oct 3, 2019

This is a special kind of thread pool executor that runs operations in a
single-threaded manner, but with a configurable cooldown in between. The
executor is always forced to have a single fixed thread with a
configurable queue size.

This special executor is not currently used, but is part of work for #47520

This is a special kind of thread pool executor that runs operations in a
single-threaded manner, but with a configurable cooldown in between. The
executor is always forced to have a single fixed thread with a
configurable queue size.

This special executor is not currently used, but is part of work for elastic#47520
@dakrone dakrone added >non-issue :Core/Infra/Core Core issues without another label labels Oct 3, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Core)

Copy link
Contributor

@gwbrown gwbrown left a comment

Choose a reason for hiding this comment

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

I don't see any obvious issues with this PR, but I'll let someone from core/infra give it a green checkmark.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

Are there any other intended uses than delaying reading from s3? I'm hesitant to add another specialized execute for such a narrow use case. Is there a problem with holding a thread while polling (with backoff) for consistency to catch up? This should normally be a very short time right?

logger.error("interrupted while waiting for [{}/{}s] cooldown to elapse (max cooldown: {})",
TimeValue.timeValueMillis(cooldownRemainingMillis),
TimeValue.timeValueMillis(cooldownRemainingMillis).seconds(),
TimeValue.timeValueMillis(cooldownMillis));
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the interrupt be restored?

Thread.currentThread().interrupt();

@jasontedor
Copy link
Member

Given the discussion in #47520, I think we can close this?

@dakrone
Copy link
Member Author

dakrone commented Oct 4, 2019

Yep, closing this.

@dakrone dakrone closed this Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >non-issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants