You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/09/18 16:25:34 UTC

[GitHub] [druid] a2l007 commented on a change in pull request #10362: Fix negative queuedSize problem in CuratorLoadQueuePeon

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org