Skip to content

Feat: Intialize ScheduledThreadPoolExecutor with default worker threads #18163

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

Merged
merged 9 commits into from
Jun 24, 2025

Conversation

uds5501
Copy link
Contributor

@uds5501 uds5501 commented Jun 20, 2025

Description

Updates workerThread calculation for ScheduledThreadPoolExecutor. It now follows the following logic:

  • honor tuningConfig.workerThreads() if set.
  • if auto scaler config / io config has max task counts specified, set worker threads to maxTaskCount/4.
  • ensure at least 2 worker threads are spawned if the determined value (maxTaskCount/4) is too low.
Key changed/added classes in this PR
  • SeekableStreamSupervisor

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@uds5501 uds5501 requested a review from kfaraz June 20, 2025 11:24
@uds5501 uds5501 requested a review from kfaraz June 23, 2025 15:12
Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Changes look good.

Left a few style, javadoc suggestions.

+1 after CI passes

Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Left some final non-blocking comments.

Rest looks good 🚀

@uds5501
Copy link
Contributor Author

uds5501 commented Jun 24, 2025

Thanks for your review @kfaraz , I have addressed the final review comments as well.

@kfaraz kfaraz merged commit 514ff19 into apache:master Jun 24, 2025
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants