a2l007 commented on a change in pull request #10362:
URL: https://github.com/apache/druid/pull/10362#discussion_r491056756



##########
File path: 
server/src/test/java/org/apache/druid/server/coordinator/LoadQueuePeonTest.java
##########
@@ -336,6 +336,12 @@ public void execute()
     Assert.assertTrue(timing.forWaiting().awaitLatch(segmentLoadedSignal));
     Assert.assertEquals(0, loadQueuePeon.getSegmentsToLoad().size());
     Assert.assertEquals(0L, loadQueuePeon.getLoadQueueSize());
+    curator.delete().guaranteed().forPath(loadRequestPath);
+    while (null != curator.checkExists().forPath(loadRequestPath)) {
+      Thread.sleep(5);

Review comment:
       Would it be better to have a separate countdown latch of size 2 and 
decrement it in the CuratorLoadQueuePeon callback and do an Assert with 
awaitLatch?

##########
File path: 
server/src/main/java/org/apache/druid/server/coordinator/CuratorLoadQueuePeon.java
##########
@@ -302,8 +302,9 @@ private void actionCompleted(SegmentHolder segmentHolder)
   {
     switch (segmentHolder.getType()) {
       case LOAD:
-        segmentsToLoad.remove(segmentHolder.getSegment());
-        queuedSize.addAndGet(-segmentHolder.getSegmentSize());
+        if (null != segmentsToLoad.remove(segmentHolder.getSegment())) {

Review comment:
       Could you please add a comment here?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to