GlenGeng commented on a change in pull request #1785:
URL: https://github.com/apache/ozone/pull/1785#discussion_r559304452



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateManagerV2Impl.java
##########
@@ -240,19 +242,39 @@ public void removeContainerFromPipeline(
   public void updatePipelineState(
       HddsProtos.PipelineID pipelineIDProto, HddsProtos.PipelineState newState)
       throws IOException {
+    PipelineID pipelineID = PipelineID.getFromProtobuf(pipelineIDProto);
+    Pipeline.PipelineState oldState =
+        getPipeline(pipelineID).getPipelineState();
     lock.writeLock().lock();
     try {
-      pipelineStateMap.updatePipelineState(
-          PipelineID.getFromProtobuf(pipelineIDProto),
-          Pipeline.PipelineState.fromProtobuf(newState));
+      // null check is here to prevent the case where SCM store
+      // is closed but the staleNode handlers/pipeline creations
+      // still try to access it.
+      if (pipelineStore != null) {

Review comment:
       Shall we add null check for `removePipeline()` ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to