You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by bh...@apache.org on 2020/03/08 04:04:21 UTC

[hadoop-ozone] branch master updated: HDDS-3089. TestSCMNodeManager intermittent crash (#650)

This is an automated email from the ASF dual-hosted git repository.

bharat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 404a572  HDDS-3089. TestSCMNodeManager intermittent crash (#650)
404a572 is described below

commit 404a5729adc81c93efdbf4e1a406e0060a9f63c5
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Sun Mar 8 05:04:10 2020 +0100

    HDDS-3089. TestSCMNodeManager intermittent crash (#650)
---
 .../org/apache/hadoop/hdds/utils/RocksDBStore.java |  1 +
 .../hdds/scm/pipeline/SCMPipelineManager.java      | 23 +++++++++++++++-------
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/RocksDBStore.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/RocksDBStore.java
index 6db76b0..b399b49 100644
--- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/RocksDBStore.java
+++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/RocksDBStore.java
@@ -387,6 +387,7 @@ public class RocksDBStore implements MetadataStore {
     }
     if (db != null) {
       db.close();
+      db = null;
     }
 
   }
diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/SCMPipelineManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/SCMPipelineManager.java
index 0989d34..f44ff72 100644
--- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/SCMPipelineManager.java
+++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/SCMPipelineManager.java
@@ -562,12 +562,15 @@ public class SCMPipelineManager implements PipelineManager {
    * @throws IOException
    */
   protected void removePipeline(PipelineID pipelineId) throws IOException {
+    byte[] key = pipelineId.getProtobuf().toByteArray();
     lock.writeLock().lock();
     try {
-      pipelineStore.delete(pipelineId.getProtobuf().toByteArray());
-      Pipeline pipeline = stateManager.removePipeline(pipelineId);
-      nodeManager.removePipeline(pipeline);
-      metrics.incNumPipelineDestroyed();
+      if (pipelineStore != null) {
+        pipelineStore.delete(key);
+        Pipeline pipeline = stateManager.removePipeline(pipelineId);
+        nodeManager.removePipeline(pipeline);
+        metrics.incNumPipelineDestroyed();
+      }
     } catch (IOException ex) {
       metrics.incNumPipelineDestroyFailed();
       throw ex;
@@ -588,10 +591,16 @@ public class SCMPipelineManager implements PipelineManager {
       scheduler = null;
     }
 
-    if (pipelineStore != null) {
-      pipelineStore.close();
-      pipelineStore = null;
+    lock.writeLock().lock();
+    try {
+      if (pipelineStore != null) {
+        pipelineStore.close();
+        pipelineStore = null;
+      }
+    } finally {
+      lock.writeLock().unlock();
     }
+
     if(pmInfoBean != null) {
       MBeans.unregister(this.pmInfoBean);
       pmInfoBean = null;


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