HDDS-1754. getContainerWithPipeline fails with PipelineNotFoundException. Contributed by Supratim Deka (#1081)
This commit is contained in:
parent
00dd843a1a
commit
738fab3bff
|
@ -467,4 +467,12 @@ public class ContainerInfo implements Comparator<ContainerInfo>,
|
||||||
return state == HddsProtos.LifeCycleState.OPEN
|
return state == HddsProtos.LifeCycleState.OPEN
|
||||||
|| state == HddsProtos.LifeCycleState.CLOSING;
|
|| 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,7 +238,7 @@ public class SCMClientProtocolServer implements
|
||||||
getContainer(id);
|
getContainer(id);
|
||||||
final Pipeline pipeline;
|
final Pipeline pipeline;
|
||||||
|
|
||||||
if (container.isOpen()) {
|
if (container.isOpenNotClosing()) {
|
||||||
// Ratis pipeline
|
// Ratis pipeline
|
||||||
pipeline = scm.getPipelineManager()
|
pipeline = scm.getPipelineManager()
|
||||||
.getPipeline(container.getPipelineID());
|
.getPipeline(container.getPipelineID());
|
||||||
|
|
Loading…
Reference in New Issue