Forráskód Böngészése

Add synchronized on lockLeakCheck() because threadCountMap is not thread safe. (#6029)

Co-authored-by: lgh <liuguanghua@kanzhun.com>
LiuGuH 1 éve
szülő
commit
335587df9e

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataSetLockManager.java

@@ -256,7 +256,7 @@ public class DataSetLockManager implements DataNodeLockManager<AutoCloseDataSetL
     threadCountMap.putIfAbsent(thread, new TrackLog(thread));
   }
 
-  public void lockLeakCheck() {
+  public synchronized void lockLeakCheck() {
     if (!openLockTrace) {
       LOG.warn("not open lock leak check func");
       return;