From d54f5598f4ccd1031e8295a215a3183f3647031a 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. --- .../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 2d0467706e..79fa1746d1 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 EndpointStateMachine.EndPointStates call() throws Exception { // Check volumes VolumeSet volumeSet = ozoneContainer.getVolumeSet(); - volumeSet.readLock(); + volumeSet.writeLock(); try { Map volumeMap = volumeSet.getVolumeMap(); @@ -94,12 +94,12 @@ public EndpointStateMachine.EndPointStates call() throws Exception { } } 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);