[01/39] ignite git commit: ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in GridDhtPartitionsExchangeFuture.

2015-09-03 Thread agoncharuk
Repository: ignite
Updated Branches:
  refs/heads/ignite-264 8af9e64c1 -> 637afb75b


ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in 
GridDhtPartitionsExchangeFuture.


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

Branch: refs/heads/ignite-264
Commit: a61cf24b741daa679a66fc904960b74005d3e442
Parents: 612a6b8
Author: sboikov 
Authored: Mon Aug 31 03:13:52 2015 -0700
Committer: Valentin Kulichenko 
Committed: Mon Aug 31 13:01:42 2015 -0700

--
 .../processors/cache/GridCacheProcessor.java| 25 --
 .../GridDhtPartitionsExchangeFuture.java| 92 +++
 .../cache/IgniteDynamicCacheAndNodeStop.java| 95 
 .../testsuites/IgniteCacheTestSuite2.java   |  2 +
 4 files changed, 173 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 8e2b20e..f13af23 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -91,6 +91,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 /** */
 private final Map> caches;
 
+/** Caches stopped from onKernalStop callback. */
+private final Map stoppedCaches = new 
ConcurrentHashMap<>();
+
 /** Map of proxies. */
 private final Map> jCacheProxies;
 
@@ -854,14 +857,16 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 @SuppressWarnings("unchecked")
 @Override public void stop(boolean cancel) throws IgniteCheckedException {
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+GridCacheAdapter cache = 
stoppedCaches.remove(maskNull(cacheName));
 
 if (cache != null)
 stopCache(cache, cancel);
 }
 
-for (GridCacheAdapter cache : caches.values())
-stopCache(cache, cancel);
+for (GridCacheAdapter cache : stoppedCaches.values()) {
+if (cache == stoppedCaches.remove(maskNull(cache.name(
+stopCache(cache, cancel);
+}
 
 List> mgrs = 
sharedCtx.managers();
 
@@ -893,15 +898,23 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 cacheStartedLatch.countDown();
 
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.get(maskNull(cacheName));
+GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+
+if (cache != null) {
+stoppedCaches.put(maskNull(cacheName), cache);
 
-if (cache != null)
 onKernalStop(cache, cancel);
+}
 }
 
 for (Map.Entry> entry : 
caches.entrySet()) {
-if (!stopSeq.contains(entry.getKey()))
+GridCacheAdapter cache = entry.getValue();
+
+if (cache == caches.remove(entry.getKey())) {
+stoppedCaches.put(entry.getKey(), cache);
+
 onKernalStop(entry.getValue(), cancel);
+}
 }
 
 List> sharedMgrs = 
sharedCtx.managers();

http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 4971ca6..b70fbc4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1136,52 +1136,54 @@ public class GridDhtPartitionsExchangeFuture extends 
GridFutureAdapter>() {
-@Override public void apply(IgniteInternalFuture t) {
+@Override public void apply(Ign

[01/30] ignite git commit: ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in GridDhtPartitionsExchangeFuture.

2015-09-03 Thread sboikov
Repository: ignite
Updated Branches:
  refs/heads/ignite-1353 6ac9557ef -> 8dc821f37


ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in 
GridDhtPartitionsExchangeFuture.


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

Branch: refs/heads/ignite-1353
Commit: a61cf24b741daa679a66fc904960b74005d3e442
Parents: 612a6b8
Author: sboikov 
Authored: Mon Aug 31 03:13:52 2015 -0700
Committer: Valentin Kulichenko 
Committed: Mon Aug 31 13:01:42 2015 -0700

--
 .../processors/cache/GridCacheProcessor.java| 25 --
 .../GridDhtPartitionsExchangeFuture.java| 92 +++
 .../cache/IgniteDynamicCacheAndNodeStop.java| 95 
 .../testsuites/IgniteCacheTestSuite2.java   |  2 +
 4 files changed, 173 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 8e2b20e..f13af23 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -91,6 +91,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 /** */
 private final Map> caches;
 
+/** Caches stopped from onKernalStop callback. */
+private final Map stoppedCaches = new 
ConcurrentHashMap<>();
+
 /** Map of proxies. */
 private final Map> jCacheProxies;
 
@@ -854,14 +857,16 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 @SuppressWarnings("unchecked")
 @Override public void stop(boolean cancel) throws IgniteCheckedException {
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+GridCacheAdapter cache = 
stoppedCaches.remove(maskNull(cacheName));
 
 if (cache != null)
 stopCache(cache, cancel);
 }
 
-for (GridCacheAdapter cache : caches.values())
-stopCache(cache, cancel);
+for (GridCacheAdapter cache : stoppedCaches.values()) {
+if (cache == stoppedCaches.remove(maskNull(cache.name(
+stopCache(cache, cancel);
+}
 
 List> mgrs = 
sharedCtx.managers();
 
@@ -893,15 +898,23 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 cacheStartedLatch.countDown();
 
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.get(maskNull(cacheName));
+GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+
+if (cache != null) {
+stoppedCaches.put(maskNull(cacheName), cache);
 
-if (cache != null)
 onKernalStop(cache, cancel);
+}
 }
 
 for (Map.Entry> entry : 
caches.entrySet()) {
-if (!stopSeq.contains(entry.getKey()))
+GridCacheAdapter cache = entry.getValue();
+
+if (cache == caches.remove(entry.getKey())) {
+stoppedCaches.put(entry.getKey(), cache);
+
 onKernalStop(entry.getValue(), cancel);
+}
 }
 
 List> sharedMgrs = 
sharedCtx.managers();

http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 4971ca6..b70fbc4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1136,52 +1136,54 @@ public class GridDhtPartitionsExchangeFuture extends 
GridFutureAdapter>() {
-@Override public void apply(IgniteInternalFuture t) {
+@Override public void apply(I

[01/24] ignite git commit: ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in GridDhtPartitionsExchangeFuture.

2015-09-03 Thread vozerov
Repository: ignite
Updated Branches:
  refs/heads/master 6ac9557ef -> 27cd61547


ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in 
GridDhtPartitionsExchangeFuture.


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

Branch: refs/heads/master
Commit: a61cf24b741daa679a66fc904960b74005d3e442
Parents: 612a6b8
Author: sboikov 
Authored: Mon Aug 31 03:13:52 2015 -0700
Committer: Valentin Kulichenko 
Committed: Mon Aug 31 13:01:42 2015 -0700

--
 .../processors/cache/GridCacheProcessor.java| 25 --
 .../GridDhtPartitionsExchangeFuture.java| 92 +++
 .../cache/IgniteDynamicCacheAndNodeStop.java| 95 
 .../testsuites/IgniteCacheTestSuite2.java   |  2 +
 4 files changed, 173 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 8e2b20e..f13af23 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -91,6 +91,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 /** */
 private final Map> caches;
 
+/** Caches stopped from onKernalStop callback. */
+private final Map stoppedCaches = new 
ConcurrentHashMap<>();
+
 /** Map of proxies. */
 private final Map> jCacheProxies;
 
@@ -854,14 +857,16 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 @SuppressWarnings("unchecked")
 @Override public void stop(boolean cancel) throws IgniteCheckedException {
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+GridCacheAdapter cache = 
stoppedCaches.remove(maskNull(cacheName));
 
 if (cache != null)
 stopCache(cache, cancel);
 }
 
-for (GridCacheAdapter cache : caches.values())
-stopCache(cache, cancel);
+for (GridCacheAdapter cache : stoppedCaches.values()) {
+if (cache == stoppedCaches.remove(maskNull(cache.name(
+stopCache(cache, cancel);
+}
 
 List> mgrs = 
sharedCtx.managers();
 
@@ -893,15 +898,23 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 cacheStartedLatch.countDown();
 
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.get(maskNull(cacheName));
+GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+
+if (cache != null) {
+stoppedCaches.put(maskNull(cacheName), cache);
 
-if (cache != null)
 onKernalStop(cache, cancel);
+}
 }
 
 for (Map.Entry> entry : 
caches.entrySet()) {
-if (!stopSeq.contains(entry.getKey()))
+GridCacheAdapter cache = entry.getValue();
+
+if (cache == caches.remove(entry.getKey())) {
+stoppedCaches.put(entry.getKey(), cache);
+
 onKernalStop(entry.getValue(), cancel);
+}
 }
 
 List> sharedMgrs = 
sharedCtx.managers();

http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 4971ca6..b70fbc4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1136,52 +1136,54 @@ public class GridDhtPartitionsExchangeFuture extends 
GridFutureAdapter>() {
-@Override public void apply(IgniteInternalFuture t) {
+@Override public void apply(IgniteInter

[1/7] ignite git commit: ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in GridDhtPartitionsExchangeFuture.

2015-09-02 Thread sboikov
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.4 ba756cdd6 -> ba4a582ce


ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in 
GridDhtPartitionsExchangeFuture.


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

Branch: refs/heads/ignite-1.4
Commit: a61cf24b741daa679a66fc904960b74005d3e442
Parents: 612a6b8
Author: sboikov 
Authored: Mon Aug 31 03:13:52 2015 -0700
Committer: Valentin Kulichenko 
Committed: Mon Aug 31 13:01:42 2015 -0700

--
 .../processors/cache/GridCacheProcessor.java| 25 --
 .../GridDhtPartitionsExchangeFuture.java| 92 +++
 .../cache/IgniteDynamicCacheAndNodeStop.java| 95 
 .../testsuites/IgniteCacheTestSuite2.java   |  2 +
 4 files changed, 173 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 8e2b20e..f13af23 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -91,6 +91,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 /** */
 private final Map> caches;
 
+/** Caches stopped from onKernalStop callback. */
+private final Map stoppedCaches = new 
ConcurrentHashMap<>();
+
 /** Map of proxies. */
 private final Map> jCacheProxies;
 
@@ -854,14 +857,16 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 @SuppressWarnings("unchecked")
 @Override public void stop(boolean cancel) throws IgniteCheckedException {
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+GridCacheAdapter cache = 
stoppedCaches.remove(maskNull(cacheName));
 
 if (cache != null)
 stopCache(cache, cancel);
 }
 
-for (GridCacheAdapter cache : caches.values())
-stopCache(cache, cancel);
+for (GridCacheAdapter cache : stoppedCaches.values()) {
+if (cache == stoppedCaches.remove(maskNull(cache.name(
+stopCache(cache, cancel);
+}
 
 List> mgrs = 
sharedCtx.managers();
 
@@ -893,15 +898,23 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 cacheStartedLatch.countDown();
 
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.get(maskNull(cacheName));
+GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+
+if (cache != null) {
+stoppedCaches.put(maskNull(cacheName), cache);
 
-if (cache != null)
 onKernalStop(cache, cancel);
+}
 }
 
 for (Map.Entry> entry : 
caches.entrySet()) {
-if (!stopSeq.contains(entry.getKey()))
+GridCacheAdapter cache = entry.getValue();
+
+if (cache == caches.remove(entry.getKey())) {
+stoppedCaches.put(entry.getKey(), cache);
+
 onKernalStop(entry.getValue(), cancel);
+}
 }
 
 List> sharedMgrs = 
sharedCtx.managers();

http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 4971ca6..b70fbc4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1136,52 +1136,54 @@ public class GridDhtPartitionsExchangeFuture extends 
GridFutureAdapter>() {
-@Override public void apply(IgniteInternalFuture t) {
+@Override public void apply(Ign

[01/29] ignite git commit: ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in GridDhtPartitionsExchangeFuture.

2015-09-01 Thread akuznetsov
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 fcf310174 -> 577795018


ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in 
GridDhtPartitionsExchangeFuture.


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

Branch: refs/heads/ignite-843
Commit: afce2699644c8af1e50eb5ef595ed299734c68e5
Parents: 2814d0e
Author: sboikov 
Authored: Tue Sep 1 08:59:01 2015 +0300
Committer: sboikov 
Committed: Tue Sep 1 08:59:01 2015 +0300

--
 .../processors/cache/GridCacheProcessor.java| 27 --
 .../GridDhtPartitionsExchangeFuture.java| 94 +++
 .../cache/IgniteDynamicCacheAndNodeStop.java| 95 
 .../testsuites/IgniteCacheTestSuite2.java   |  3 +-
 4 files changed, 175 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/afce2699/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index bf203b8..c5f8168 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -156,6 +156,9 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 /** */
 private final Map> caches;
 
+/** Caches stopped from onKernalStop callback. */
+private final Map stoppedCaches = new 
ConcurrentHashMap<>();
+
 /** Map of proxies. */
 private final Map> jCacheProxies;
 
@@ -893,14 +896,16 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 @SuppressWarnings("unchecked")
 @Override public void stop(boolean cancel) throws IgniteCheckedException {
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+GridCacheAdapter cache = 
stoppedCaches.remove(maskNull(cacheName));
 
 if (cache != null)
 stopCache(cache, cancel);
 }
 
-for (GridCacheAdapter cache : caches.values())
-stopCache(cache, cancel);
+for (GridCacheAdapter cache : stoppedCaches.values()) {
+if (cache == stoppedCaches.remove(maskNull(cache.name(
+stopCache(cache, cancel);
+}
 
 List> mgrs = 
sharedCtx.managers();
 
@@ -932,15 +937,23 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 cacheStartedLatch.countDown();
 
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.get(maskNull(cacheName));
+GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+
+if (cache != null) {
+stoppedCaches.put(maskNull(cacheName), cache);
 
-if (cache != null)
 onKernalStop(cache, cancel);
+}
 }
 
 for (Map.Entry> entry : 
caches.entrySet()) {
-if (!stopSeq.contains(entry.getKey()))
+GridCacheAdapter cache = entry.getValue();
+
+if (cache == caches.remove(entry.getKey())) {
+stoppedCaches.put(entry.getKey(), cache);
+
 onKernalStop(entry.getValue(), cancel);
+}
 }
 
 List> sharedMgrs = 
sharedCtx.managers();
@@ -3457,4 +3470,4 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 // No-op.
 }
 }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/afce2699/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 414a152..865bbdc 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1146,52 +1146,54 @@ public class GridDhtPartitionsExchangeFuture 

[62/82] [abbrv] ignite git commit: ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in GridDhtPartitionsExchangeFuture.

2015-09-01 Thread sboikov
ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in 
GridDhtPartitionsExchangeFuture.


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

Branch: refs/heads/ignite-1093-2
Commit: afce2699644c8af1e50eb5ef595ed299734c68e5
Parents: 2814d0e
Author: sboikov 
Authored: Tue Sep 1 08:59:01 2015 +0300
Committer: sboikov 
Committed: Tue Sep 1 08:59:01 2015 +0300

--
 .../processors/cache/GridCacheProcessor.java| 27 --
 .../GridDhtPartitionsExchangeFuture.java| 94 +++
 .../cache/IgniteDynamicCacheAndNodeStop.java| 95 
 .../testsuites/IgniteCacheTestSuite2.java   |  3 +-
 4 files changed, 175 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/afce2699/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index bf203b8..c5f8168 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -156,6 +156,9 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 /** */
 private final Map> caches;
 
+/** Caches stopped from onKernalStop callback. */
+private final Map stoppedCaches = new 
ConcurrentHashMap<>();
+
 /** Map of proxies. */
 private final Map> jCacheProxies;
 
@@ -893,14 +896,16 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 @SuppressWarnings("unchecked")
 @Override public void stop(boolean cancel) throws IgniteCheckedException {
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+GridCacheAdapter cache = 
stoppedCaches.remove(maskNull(cacheName));
 
 if (cache != null)
 stopCache(cache, cancel);
 }
 
-for (GridCacheAdapter cache : caches.values())
-stopCache(cache, cancel);
+for (GridCacheAdapter cache : stoppedCaches.values()) {
+if (cache == stoppedCaches.remove(maskNull(cache.name(
+stopCache(cache, cancel);
+}
 
 List> mgrs = 
sharedCtx.managers();
 
@@ -932,15 +937,23 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 cacheStartedLatch.countDown();
 
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.get(maskNull(cacheName));
+GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+
+if (cache != null) {
+stoppedCaches.put(maskNull(cacheName), cache);
 
-if (cache != null)
 onKernalStop(cache, cancel);
+}
 }
 
 for (Map.Entry> entry : 
caches.entrySet()) {
-if (!stopSeq.contains(entry.getKey()))
+GridCacheAdapter cache = entry.getValue();
+
+if (cache == caches.remove(entry.getKey())) {
+stoppedCaches.put(entry.getKey(), cache);
+
 onKernalStop(entry.getValue(), cancel);
+}
 }
 
 List> sharedMgrs = 
sharedCtx.managers();
@@ -3457,4 +3470,4 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 // No-op.
 }
 }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/afce2699/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 414a152..865bbdc 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1146,52 +1146,54 @@ public class GridDhtPartitionsExchangeFuture extends 
GridFutureAdapter>() {
-@Override public void apply(Ignite

ignite git commit: ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in GridDhtPartitionsExchangeFuture.

2015-08-31 Thread sboikov
Repository: ignite
Updated Branches:
  refs/heads/master 2814d0e91 -> afce26996


ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in 
GridDhtPartitionsExchangeFuture.


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

Branch: refs/heads/master
Commit: afce2699644c8af1e50eb5ef595ed299734c68e5
Parents: 2814d0e
Author: sboikov 
Authored: Tue Sep 1 08:59:01 2015 +0300
Committer: sboikov 
Committed: Tue Sep 1 08:59:01 2015 +0300

--
 .../processors/cache/GridCacheProcessor.java| 27 --
 .../GridDhtPartitionsExchangeFuture.java| 94 +++
 .../cache/IgniteDynamicCacheAndNodeStop.java| 95 
 .../testsuites/IgniteCacheTestSuite2.java   |  3 +-
 4 files changed, 175 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/afce2699/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index bf203b8..c5f8168 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -156,6 +156,9 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 /** */
 private final Map> caches;
 
+/** Caches stopped from onKernalStop callback. */
+private final Map stoppedCaches = new 
ConcurrentHashMap<>();
+
 /** Map of proxies. */
 private final Map> jCacheProxies;
 
@@ -893,14 +896,16 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 @SuppressWarnings("unchecked")
 @Override public void stop(boolean cancel) throws IgniteCheckedException {
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+GridCacheAdapter cache = 
stoppedCaches.remove(maskNull(cacheName));
 
 if (cache != null)
 stopCache(cache, cancel);
 }
 
-for (GridCacheAdapter cache : caches.values())
-stopCache(cache, cancel);
+for (GridCacheAdapter cache : stoppedCaches.values()) {
+if (cache == stoppedCaches.remove(maskNull(cache.name(
+stopCache(cache, cancel);
+}
 
 List> mgrs = 
sharedCtx.managers();
 
@@ -932,15 +937,23 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 cacheStartedLatch.countDown();
 
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.get(maskNull(cacheName));
+GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+
+if (cache != null) {
+stoppedCaches.put(maskNull(cacheName), cache);
 
-if (cache != null)
 onKernalStop(cache, cancel);
+}
 }
 
 for (Map.Entry> entry : 
caches.entrySet()) {
-if (!stopSeq.contains(entry.getKey()))
+GridCacheAdapter cache = entry.getValue();
+
+if (cache == caches.remove(entry.getKey())) {
+stoppedCaches.put(entry.getKey(), cache);
+
 onKernalStop(entry.getValue(), cancel);
+}
 }
 
 List> sharedMgrs = 
sharedCtx.managers();
@@ -3457,4 +3470,4 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 // No-op.
 }
 }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/afce2699/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 414a152..865bbdc 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1146,52 +1146,54 @@ public class GridDhtPartitionsExchangeFuture extends 

ignite git commit: ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in GridDhtPartitionsExchangeFuture.

2015-08-31 Thread vkulichenko
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.3.3-p7 [created] a61cf24b7


ignite-1334 Fixed concurrent destroyCache/node stop. Check initFut result in 
GridDhtPartitionsExchangeFuture.


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

Branch: refs/heads/ignite-1.3.3-p7
Commit: a61cf24b741daa679a66fc904960b74005d3e442
Parents: 612a6b8
Author: sboikov 
Authored: Mon Aug 31 03:13:52 2015 -0700
Committer: Valentin Kulichenko 
Committed: Mon Aug 31 13:01:42 2015 -0700

--
 .../processors/cache/GridCacheProcessor.java| 25 --
 .../GridDhtPartitionsExchangeFuture.java| 92 +++
 .../cache/IgniteDynamicCacheAndNodeStop.java| 95 
 .../testsuites/IgniteCacheTestSuite2.java   |  2 +
 4 files changed, 173 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 8e2b20e..f13af23 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -91,6 +91,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 /** */
 private final Map> caches;
 
+/** Caches stopped from onKernalStop callback. */
+private final Map stoppedCaches = new 
ConcurrentHashMap<>();
+
 /** Map of proxies. */
 private final Map> jCacheProxies;
 
@@ -854,14 +857,16 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 @SuppressWarnings("unchecked")
 @Override public void stop(boolean cancel) throws IgniteCheckedException {
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+GridCacheAdapter cache = 
stoppedCaches.remove(maskNull(cacheName));
 
 if (cache != null)
 stopCache(cache, cancel);
 }
 
-for (GridCacheAdapter cache : caches.values())
-stopCache(cache, cancel);
+for (GridCacheAdapter cache : stoppedCaches.values()) {
+if (cache == stoppedCaches.remove(maskNull(cache.name(
+stopCache(cache, cancel);
+}
 
 List> mgrs = 
sharedCtx.managers();
 
@@ -893,15 +898,23 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 cacheStartedLatch.countDown();
 
 for (String cacheName : stopSeq) {
-GridCacheAdapter cache = caches.get(maskNull(cacheName));
+GridCacheAdapter cache = caches.remove(maskNull(cacheName));
+
+if (cache != null) {
+stoppedCaches.put(maskNull(cacheName), cache);
 
-if (cache != null)
 onKernalStop(cache, cancel);
+}
 }
 
 for (Map.Entry> entry : 
caches.entrySet()) {
-if (!stopSeq.contains(entry.getKey()))
+GridCacheAdapter cache = entry.getValue();
+
+if (cache == caches.remove(entry.getKey())) {
+stoppedCaches.put(entry.getKey(), cache);
+
 onKernalStop(entry.getValue(), cancel);
+}
 }
 
 List> sharedMgrs = 
sharedCtx.managers();

http://git-wip-us.apache.org/repos/asf/ignite/blob/a61cf24b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
--
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 4971ca6..b70fbc4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1136,52 +1136,54 @@ public class GridDhtPartitionsExchangeFuture extends 
GridFutureAdapter>() {
-@Override public void apply(IgniteInternalFuture t) {
+@Override public void ap