-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Conversation
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
Pinging @elastic/es-core-infra (:Core/Infra/Core) |
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.
I don't see any obvious issues with this PR, but I'll let someone from core/infra give it a green checkmark.
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.
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)); |
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.
Shouldn't the interrupt be restored?
Thread.currentThread().interrupt();
Given the discussion in #47520, I think we can close this? |
Yep, closing this. |
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