ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [12/25] ignite git commit: IGNITE-5739 Fixed Ignite node crash on deactivation
Date Mon, 09 Oct 2017 10:42:28 GMT
IGNITE-5739 Fixed Ignite node crash on deactivation


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3b1cad21
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3b1cad21
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3b1cad21

Branch: refs/heads/ignite-3478
Commit: 3b1cad2156e6230760fface6c7cd00d3f3526255
Parents: 3c355e9
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Thu Oct 5 17:37:04 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Oct 5 17:37:04 2017 +0300

----------------------------------------------------------------------
 .../GridCacheDatabaseSharedManager.java           |  2 ++
 .../cache/persistence/pagemem/PageMemoryImpl.java | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3b1cad21/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index 33f065e..9a2e028 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -540,6 +540,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
         try {
             cctx.kernalContext().config().getMBeanServer().unregisterMBean(persistenceMetricsMbeanName);
+
+            persistenceMetricsMbeanName = null;
         }
         catch (Throwable e) {
             U.error(log, "Failed to unregister " + MBEAN_NAME + " MBean.", e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/3b1cad21/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
index 1da17b5..95b81ad 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
@@ -237,6 +237,9 @@ public class PageMemoryImpl implements PageMemoryEx {
     /** */
     private MemoryMetricsImpl memMetrics;
 
+    /** */
+    private volatile boolean closed;
+
     /**
      * @param directMemoryProvider Memory allocator to use.
      * @param sharedCtx Cache shared context.
@@ -358,6 +361,15 @@ public class PageMemoryImpl implements PageMemoryEx {
 
         U.shutdownNow(getClass(), asyncRunner, log);
 
+        closed = true;
+
+        for (Segment seg : segments) {
+            // Make sure all threads have left the lock.
+            seg.writeLock().lock();
+
+            seg.writeLock().unlock();
+        }
+
         directMemoryProvider.shutdown();
     }
 
@@ -1093,6 +1105,9 @@ public class PageMemoryImpl implements PageMemoryEx {
                 seg.readLock().lock();
 
                 try {
+                    if (closed)
+                        continue;
+
                     total += seg.loadedPages.size();
                 }
                 finally {
@@ -1114,6 +1129,9 @@ public class PageMemoryImpl implements PageMemoryEx {
             seg.readLock().lock();
 
             try {
+                if (closed)
+                    continue;
+
                 total += seg.acquiredPages();
             }
             finally {


Mime
View raw message