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: [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]

Reply via email to