lintingbin commented on code in PR #3583:
URL: https://github.com/apache/amoro/pull/3583#discussion_r2113462046


##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java:
##########
@@ -399,14 +399,16 @@ private class TableOptimizingProcess implements 
OptimizingProcess {
     private boolean hasCommitted = false;
 
     public TaskRuntime<?> poll() {
-      lock.lock();
-      try {
-        return status != ProcessStatus.KILLED && status != ProcessStatus.FAILED
-            ? taskQueue.poll()
-            : null;
-      } finally {
-        lock.unlock();
+      if (lock.tryLock()) {

Review Comment:
   <img width="713" alt="image" 
src="https://github.com/user-attachments/assets/a3c7e79d-2230-4bca-a0e4-922ca870939b";
 />
   Here is an example of using Java documentation. It seems better to place the 
unlock inside the tryLock code block.
   
   > nit
   
   



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

Reply via email to