Skip to content

HDDS-15648. Improve TestSnapshotDiffManager#testThreadPoolIsFull drai n scenario by filling the pool before releasing workers#10632

Draft
cchung100m wants to merge 2 commits into
apache:masterfrom
cchung100m:hdds-15648
Draft

HDDS-15648. Improve TestSnapshotDiffManager#testThreadPoolIsFull drai n scenario by filling the pool before releasing workers#10632
cchung100m wants to merge 2 commits into
apache:masterfrom
cchung100m:hdds-15648

Conversation

@cchung100m

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Improve TestSnapshotDiffManager#testThreadPoolIsFull drai n scenario by filling the pool before releasing workers

What is the link to the Apache JIRA

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

How was this patch tested?

Existing unit and integration tests

…n scenario by filling the pool before releasing workers
@cchung100m cchung100m marked this pull request as ready for review June 30, 2026 01:16
Comment on lines +1215 to +1219
if (drainBetweenBatches && latchOpened) {
while (totalSubmitted - completedJobs.get() >= fullThreadPoolSize) {
Thread.sleep(10);
}
}

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.

Thanks @cchung100m for working on this. We should avoid using a while loop with Thread.sleep for busy-waiting here. Let's refactor this using JavaUtils#attempt to make the waiting logic cleaner and safer.

@cchung100m cchung100m marked this pull request as draft June 30, 2026 05:53
@cchung100m cchung100m force-pushed the hdds-15648 branch 7 times, most recently from c1ac22a to c210dc6 Compare June 30, 2026 16:12
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.

2 participants