Skip to content

HDDS-15114. Replace misconfigured ThreadPoolExecutor with Executors factory methods#10133

Open
ptlrs wants to merge 5 commits into
apache:masterfrom
ptlrs:HDDS-15114-Fix-misconfigured-threadpools
Open

HDDS-15114. Replace misconfigured ThreadPoolExecutor with Executors factory methods#10133
ptlrs wants to merge 5 commits into
apache:masterfrom
ptlrs:HDDS-15114-Fix-misconfigured-threadpools

Conversation

@ptlrs
Copy link
Copy Markdown
Contributor

@ptlrs ptlrs commented Apr 25, 2026

What changes were proposed in this pull request?

Some threadpools are misconfigured. Their effective number of threads is one or they never reach their maximum number of threads.

This PR:

  • Updates misconfigured threadpools to have more than one thread
  • Update misconfigured thredpools to be limited to their number of core threads

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15114

How was this patch tested?

CI: https://github.com/ptlrs/ozone/actions/runs/24918410704

Copy link
Copy Markdown
Contributor

@devmadhuu devmadhuu left a comment

Choose a reason for hiding this comment

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

Thanks @ptlrs for the patch. Largely LGTM, just a minor comment for an existing code.

Comment thread hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/TarExtractor.java Outdated
@ptlrs ptlrs requested a review from devmadhuu April 27, 2026 17:29
@devmadhuu
Copy link
Copy Markdown
Contributor

Thanks @ptlrs for updating the patch. Can we add atleast one integration test testing the change because now there can be multiple concurrent worker threads running for downloading the OM DB tar for multiple sst files. May be a test that verifies tasks submitted to TarExtractor can run in parallel. I mean we can assert active threads count to verify throughput.

@ptlrs ptlrs requested a review from devmadhuu May 2, 2026 03:24
Copy link
Copy Markdown
Contributor

@devmadhuu devmadhuu left a comment

Choose a reason for hiding this comment

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

Thanks @ptlrs for improving the patch. Just few nits. Pls check.

…add configurable thread pool size for DataNode metrics collection.
@ptlrs ptlrs requested a review from devmadhuu May 6, 2026 16:42
Copy link
Copy Markdown
Contributor

@devmadhuu devmadhuu left a comment

Choose a reason for hiding this comment

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

Thanks @ptlrs for improving the patch. LGTM +1

@ptlrs ptlrs marked this pull request as ready for review May 7, 2026 16:29
Copy link
Copy Markdown
Contributor

@priyeshkaratha priyeshkaratha left a comment

Choose a reason for hiding this comment

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

Thanks @ptlrs for the patch. Changes LGTM

Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @ptlrs for the patch. I think TestTarExtractor is a bit too heavy and possibly flaky for a test that verifies built-in functionality (thread pool). Can it be changed to just test the creation of the thread pool? (Mock Executors static methods and check that the right one is called.)

Comment on lines +93 to +94
if (extractionError.get() != null) {
throw new AssertionError("Tar extraction failed", extractionError.get());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: why not assertNull?

throw new AssertionError("Tar extraction failed", extractionError.get());
}

assertEquals(poolSize, writeFileThreads.size(),
Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai May 11, 2026

Choose a reason for hiding this comment

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

Will this be flaky, i.e. fail if the loop does not manage to capture all extractor threads?

@ptlrs ptlrs requested a review from adoroszlai June 1, 2026 17:49
Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @ptlrs for updating the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants