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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -849,17 +848,22 @@ public void takeSnapshot() {
       _logger.info("Skip taking snapshot because metadata manager is already 
stopped");
       return;
     }
-    _snapshotLock.writeLock().lock();
+
     try {
       long startTime = System.currentTimeMillis();
+      while (!_snapshotLock.writeLock().tryLock(5, TimeUnit.MINUTES)) {
+        _logger.warn("Unable to acquire snapshotLock.writeLock in: {}", 
System.currentTimeMillis() - startTime);
+      }

Review Comment:
   Let's move this outside of the `try` block, then we don't need other 
changes, and this is the best practice



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