You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/08/19 21:17:18 UTC

[GitHub] [ozone] aswinshakil commented on a change in pull request #2548: HDDS-5611. Fixed NullPointerException in ContainerStateMachine during Pipeline Close.

aswinshakil commented on a change in pull request #2548:
URL: https://github.com/apache/ozone/pull/2548#discussion_r692493295



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerController.java
##########
@@ -79,9 +84,18 @@ public String getContainerLocation(final long containerId) {
   public void markContainerForClose(final long containerId)
       throws IOException {
     Container container = containerSet.getContainer(containerId);
-
-    if (container.getContainerState() == State.OPEN) {
-      getHandler(container).markContainerForClose(container);
+    if (container==null) {
+      Set<Long> missingContainerSet = containerSet.getMissingContainerSet();
+      if (missingContainerSet.contains(containerId)) {
+        LOG.warn("The Container is in the MissingContainerSet " +
+                "hence we can't close it. ContainerID: {}", containerId);
+      } else {
+        LOG.warn("The Container is not found. ContainerID: {}", containerId);
+      }
+    } else {
+      if (container.getContainerState() == State.OPEN) {
+        getHandler(container).markContainerForClose(container);
+      }

Review comment:
       Thank you for your input. I have place Log here so that we could have a better understanding of whether the container is present in the MissingContainerSet or not which allows us to debug better. @avijayanhwx your thoughts on that? 




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org