HDDS-1754. getContainerWithPipeline fails with PipelineNotFoundException. Contributed by Supratim Deka (#1081)

This commit is contained in:
supratimdeka 2019-07-12 10:31:48 +05:30 committed by Nanda kumar
parent 00dd843a1a
commit 738fab3bff
2 changed files with 9 additions and 1 deletions

View File

@ -467,4 +467,12 @@ public boolean isOpen() {
return state == HddsProtos.LifeCycleState.OPEN
|| state == HddsProtos.LifeCycleState.CLOSING;
}
/**
* Check if a container is in Open state, but Close has not been initiated.
* @return true if Open, false otherwise.
*/
public boolean isOpenNotClosing() {
return state == HddsProtos.LifeCycleState.OPEN;
}
}

View File

@ -238,7 +238,7 @@ public ContainerWithPipeline getContainerWithPipeline(long containerID)
getContainer(id);
final Pipeline pipeline;
if (container.isOpen()) {
if (container.isOpenNotClosing()) {
// Ratis pipeline
pipeline = scm.getPipelineManager()
.getPipeline(container.getPipelineID());