You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by fe...@apache.org on 2021/09/25 10:18:07 UTC

[hadoop] branch trunk updated: HDFS-16235. Fix Deadlock in LeaseRenewer for static remove method (#3472)

This is an automated email from the ASF dual-hosted git repository.

ferhui pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 5f9321a  HDFS-16235. Fix Deadlock in LeaseRenewer for static remove method (#3472)
5f9321a is described below

commit 5f9321a5d4112e7b4ee9e6b948ce46a2b152a2db
Author: AngersZhuuuu <an...@gmail.com>
AuthorDate: Sat Sep 25 18:17:44 2021 +0800

    HDFS-16235. Fix Deadlock in LeaseRenewer for static remove method (#3472)
---
 .../main/java/org/apache/hadoop/hdfs/client/impl/LeaseRenewer.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/LeaseRenewer.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/LeaseRenewer.java
index 6b4c899..fcacdaa 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/LeaseRenewer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/LeaseRenewer.java
@@ -96,7 +96,9 @@ public class LeaseRenewer {
    * @param renewer Instance to be cleared from Factory
    */
   public static void remove(LeaseRenewer renewer) {
-    Factory.INSTANCE.remove(renewer);
+    synchronized (renewer) {
+      Factory.INSTANCE.remove(renewer);
+    }
   }
 
   /**

---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org