/** * Updates the failed volume info in the volumeFailureInfos Map * and calls {@link #removeVolume(FsVolumeImpl)} to remove the volume * from the volume list for each of the failed volumes. * * @param failedVolumes set of volumes marked failed. */ void handleVolumeFailures(Set<FsVolumeSpi> failedVolumes) { try (AutoCloseableLock lock = checkDirsLock.acquire()) { for(FsVolumeSpi vol : failedVolumes) { FsVolumeImpl fsv = (FsVolumeImpl) vol; try (FsVolumeReference ref = fsv.obtainReference()) { addVolumeFailureInfo(fsv); removeVolume(fsv); } catch (ClosedChannelException e) { FsDatasetImpl.LOG.debug("Caught exception when obtaining " + "reference count on closed volume", e); } catch (IOException e) { FsDatasetImpl.LOG.error("Unexpected IOException", e); } } waitVolumeRemoved(5000, checkDirsLockCondition); } }
volumes.waitVolumeRemoved(5000, datasetLockCondition);