Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,8 @@ public void updatePipelineState(
HddsProtos.PipelineID pipelineIDProto, HddsProtos.PipelineState newState)
throws IOException {
PipelineID pipelineID = PipelineID.getFromProtobuf(pipelineIDProto);
Pipeline.PipelineState oldState = null;
lock.writeLock().lock();
try {
oldState = getPipeline(pipelineID).getPipelineState();
// null check is here to prevent the case where SCM store
// is closed but the staleNode handlers/pipeline creations
// still try to access it.
Expand All @@ -275,9 +273,8 @@ public void updatePipelineState(
LOG.warn("Pipeline {} is not found in the pipeline Map. Pipeline"
+ " may have been deleted already.", pipelineID);
} catch (IOException ex) {
LOG.warn("Pipeline {} state update failed", pipelineID);
// revert back to old state in memory
pipelineStateMap.updatePipelineState(pipelineID, oldState);
LOG.error("Pipeline {} state update failed", pipelineID);
throw ex;
} finally {
lock.writeLock().unlock();
}
Expand Down