cchung100m commented on code in PR #10632:
URL: https://github.com/apache/ozone/pull/10632#discussion_r3502933713
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java:
##########
@@ -1195,29 +1195,32 @@ public void testThreadPoolIsFull(String description,
eq(VOLUME_NAME), eq(BUCKET_NAME), anyString(), anyString(),
eq(false), eq(false));
- if (drainBetweenBatches) {
- blockWorkers.countDown();
- }
-
try {
List<SnapshotDiffResponse> responses = new ArrayList<>();
int totalSubmitted = 0;
+ int fullThreadPoolSize = 2 *
OZONE_OM_SNAPSHOT_DIFF_THREAD_POOL_SIZE_DEFAULT;
+ boolean latchOpened = false;
+
for (int i = 0; i < snapshotInfos.size(); i++) {
for (int j = i + 1; j < snapshotInfos.size(); j++) {
String fromSnapshotName = snapshotInfos.get(i).getName();
String toSnapshotName = snapshotInfos.get(j).getName();
+
+ if (drainBetweenBatches && !latchOpened &&
+ totalSubmitted >= fullThreadPoolSize) {
+ blockWorkers.countDown();
+ latchOpened = true;
+ }
+
+ if (drainBetweenBatches && latchOpened) {
+ while (totalSubmitted - completedJobs.get() >= fullThreadPoolSize)
{
+ Thread.sleep(10);
+ }
+ }
Review Comment:
Hi @chungen0126
Thanks for review comments. I have updated the part you mentioned.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]