You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "szetszwo (via GitHub)" <gi...@apache.org> on 2023/05/15 09:35:36 UTC

[GitHub] [ozone] szetszwo commented on a diff in pull request #4688: HDDS-8575. Intermittent failure in TestCloseContainerEventHandler.testCloseContainerWithDelayByLeaseManager

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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org