szetszwo commented on code in PR #4688:
URL: https://github.com/apache/ozone/pull/4688#discussion_r1193581122


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/lease/LeaseManager.java:
##########
@@ -45,8 +49,8 @@
 
   private final String name;
   private final long defaultTimeout;
-  private final Object monitor = new Object();
   private Map<T, Lease<T>> activeLeases;
+  private BlockingQueue<T> leaseKeyBlockingQueue;

Review Comment:
   We should use Semaphore in this case; see 
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Semaphore.html



##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/lease/LeaseManager.java:
##########
@@ -204,9 +205,8 @@ public void shutdown() {
     checkStatus();
     LOG.debug("Shutting down LeaseManager service");
     leaseMonitor.disable();
-    synchronized (monitor) {

Review Comment:
   `shutdown()` should be `synchronized`.



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