Skip to content

HDDS-15648. Improve TestSnapshotDiffManager#testThreadPoolIsFull drain scenario#10632

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

HDDS-15648. Improve TestSnapshotDiffManager#testThreadPoolIsFull drain scenario#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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @chungen0126
Thanks for review comments. I have updated the part you mentioned.

@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
@cchung100m cchung100m marked this pull request as ready for review July 1, 2026 02:39
@adoroszlai adoroszlai changed the title HDDS-15648. Improve TestSnapshotDiffManager#testThreadPoolIsFull drai n scenario by filling the pool before releasing workers HDDS-15648. Improve TestSnapshotDiffManager#testThreadPoolIsFull drain scenario Jul 1, 2026
@adoroszlai adoroszlai added the test label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants