Skip to content

Commit 8a77a22

Browse files
linyiqunjojochuang
authored andcommitted
HDFS-13359. DataXceiver hung due to the lock in FsDatasetImpl#getBlockInputStream. Contributed by Yiqun Lin.
Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
1 parent e02ffed commit 8a77a22

File tree

1 file changed

+1
-1
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl

1 file changed

+1
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ public InputStream getBlockInputStream(ExtendedBlock b,
794794
long seekOffset) throws IOException {
795795

796796
ReplicaInfo info;
797-
synchronized(this) {
797+
try (AutoCloseableLock lock = datasetLock.acquire()) {
798798
info = volumeMap.get(b.getBlockPoolId(), b.getLocalBlock());
799799
}
800800

0 commit comments

Comments
 (0)