HDDS-661. When a volume fails in datanode, VersionEndpointTask#call ends up in dead lock. Contributed by Hanisha Koneru.

(cherry picked from commit d54f5598f4)
This commit is contained in:
Nandakumar 2018-10-17 18:44:05 +05:30
parent b2ab592e0a
commit 51a79cc71d
1 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ public class VersionEndpointTask implements
// Check volumes // Check volumes
VolumeSet volumeSet = ozoneContainer.getVolumeSet(); VolumeSet volumeSet = ozoneContainer.getVolumeSet();
volumeSet.readLock(); volumeSet.writeLock();
try { try {
Map<String, HddsVolume> volumeMap = volumeSet.getVolumeMap(); Map<String, HddsVolume> volumeMap = volumeSet.getVolumeMap();
@ -94,12 +94,12 @@ public class VersionEndpointTask implements
} }
} }
if (volumeSet.getVolumesList().size() == 0) { if (volumeSet.getVolumesList().size() == 0) {
// All volumes are inconsistent state // All volumes are in inconsistent state
throw new DiskOutOfSpaceException("All configured Volumes are in " + throw new DiskOutOfSpaceException("All configured Volumes are in " +
"Inconsistent State"); "Inconsistent State");
} }
} finally { } finally {
volumeSet.readUnlock(); volumeSet.writeUnlock();
} }
ozoneContainer.getDispatcher().setScmId(scmId); ozoneContainer.getDispatcher().setScmId(scmId);