Jackie-Jiang commented on code in PR #14955:
URL: https://github.com/apache/pinot/pull/14955#discussion_r1936394721


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeSegmentDataManager.java:
##########
@@ -1652,7 +1652,11 @@ public RealtimeSegmentDataManager(SegmentZKMetadata 
segmentZKMetadata, TableConf
 
     // Acquire semaphore to create stream consumers
     try {
-      _partitionGroupConsumerSemaphore.acquire();
+      Instant acquireStart = Instant.now();
+      while (!_partitionGroupConsumerSemaphore.tryAcquire(5, 
TimeUnit.MINUTES)) {
+        _segmentLogger.warn("Failed to acquire partitionGroupConsumerSemaphore 
in: {} . Retrying.",
+            Duration.between(acquireStart, Instant.now()));
+      }

Review Comment:
   (minor) We usually use `System.currentTimeMillis()` which should have 
smaller overhead
   ```suggestion
         long startTimeMs = System.currentTimeMillis();
         while (!_partitionGroupConsumerSemaphore.tryAcquire(5, 
TimeUnit.MINUTES)) {
           _segmentLogger.warn("Failed to acquire 
partitionGroupConsumerSemaphore in: {}ms. Retrying.", 
System.currentTimeMillis() - startTimeMs);
         }
   ```



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to