From 51a79cc71d6c35b9ec4d22de61587c8beda969d9 Mon Sep 17 00:00:00 2001 From: Nandakumar Date: Wed, 17 Oct 2018 18:44:05 +0530 Subject: [PATCH] HDDS-661. When a volume fails in datanode, VersionEndpointTask#call ends up in dead lock. Contributed by Hanisha Koneru. (cherry picked from commit d54f5598f4ccd1031e8295a215a3183f3647031a) --- .../common/states/endpoint/VersionEndpointTask.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/VersionEndpointTask.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/VersionEndpointTask.java index 2d0467706ec..79fa1746d1c 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/VersionEndpointTask.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/VersionEndpointTask.java @@ -75,7 +75,7 @@ public class VersionEndpointTask implements // Check volumes VolumeSet volumeSet = ozoneContainer.getVolumeSet(); - volumeSet.readLock(); + volumeSet.writeLock(); try { Map volumeMap = volumeSet.getVolumeMap(); @@ -94,12 +94,12 @@ public class VersionEndpointTask implements } } if (volumeSet.getVolumesList().size() == 0) { - // All volumes are inconsistent state + // All volumes are in inconsistent state throw new DiskOutOfSpaceException("All configured Volumes are in " + "Inconsistent State"); } } finally { - volumeSet.readUnlock(); + volumeSet.writeUnlock(); } ozoneContainer.getDispatcher().setScmId(scmId);