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

weichiu pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new a7bc09c  HDFS-13359. DataXceiver hung due to the lock in 
FsDatasetImpl#getBlockInputStream. Contributed by Yiqun Lin.
a7bc09c is described below

commit a7bc09c596d99812f104483bb752fed9de7b4d32
Author: Yiqun Lin <yq...@apache.org>
AuthorDate: Fri Aug 9 18:38:57 2019 -0700

    HDFS-13359. DataXceiver hung due to the lock in 
FsDatasetImpl#getBlockInputStream. Contributed by Yiqun Lin.
    
    Signed-off-by: Wei-Chiu Chuang <weic...@apache.org>
    (cherry picked from commit 8a77a224c734bea0eb490f30c908748458c190c3)
---
 .../hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
index cf45e8d..b896269 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
@@ -778,7 +778,7 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
       long seekOffset) throws IOException {
 
     ReplicaInfo info;
-    synchronized(this) {
+    try (AutoCloseableLock lock = datasetLock.acquire()) {
       info = volumeMap.get(b.getBlockPoolId(), b.getLocalBlock());
     }
 


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

Reply via email to