You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/12 16:13:18 UTC

[1/2] incubator-ignite git commit: Fixed test. Cache doesn't start in transaction.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-classname fe1750d3f -> e17a2be1b


Fixed test. Cache doesn't start in transaction.


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

Branch: refs/heads/ignite-classname
Commit: e158c90fe58082e00d97f26c5bb3ae450906fc6a
Parents: fe1750d
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 17:11:27 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 17:11:27 2015 +0300

----------------------------------------------------------------------
 .../cache/IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e158c90f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
index a4e2753..017f7db 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
@@ -50,9 +50,12 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
      * Sends put with optimistic lock and handles fail.
      */
     protected void failOptimistic() {
-        try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+        IgniteCache<Object, Object> cache = jcache(0);
 
-            jcache(0).put(new TestKey(String.valueOf(++key)), "");
+        try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC,
+            TransactionIsolation.REPEATABLE_READ)) {
+
+            cache.put(new TestKey(String.valueOf(++key)), "");
 
             tx.commit();
 
@@ -69,9 +72,12 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
      * Sends put with pessimistic lock and handles fail.
      */
     protected void failPessimictic() {
-        try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+        IgniteCache<Object, Object> cache = jcache(0);
+
+        try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC,
+            TransactionIsolation.REPEATABLE_READ)) {
 
-            jcache(0).put(new TestKey(String.valueOf(++key)), "");
+            cache.put(new TestKey(String.valueOf(++key)), "");
 
             assert false : "p2p marshalling failed, but error response was not sent";
         }


[2/2] incubator-ignite git commit: Release latch in marshaller context in stop method.

Posted by sb...@apache.org.
Release latch in marshaller context in stop method.


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

Branch: refs/heads/ignite-classname
Commit: e17a2be1b931ea6b4e56be653b73a7994fd59898
Parents: e158c90
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 17:13:06 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 17:13:06 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/internal/IgniteKernal.java    | 2 ++
 .../org/apache/ignite/internal/MarshallerContextImpl.java     | 7 +++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e17a2be1/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 9b2ae27..9da3346 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -1705,6 +1705,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
 
             List<GridComponent> comps = ctx.components();
 
+            ctx.marshallerContext().onKernalStop();
+
             // Callback component in reverse order while kernal is still functional
             // if called in the same thread, at least.
             for (ListIterator<GridComponent> it = comps.listIterator(comps.size()); it.hasPrevious();) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e17a2be1/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index 7940e95..48f24ac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -83,6 +83,13 @@ public class MarshallerContextImpl extends MarshallerContextAdapter {
         latch.countDown();
     }
 
+    /**
+     * Release marshaller context.
+     */
+    public void onKernalStop() {
+        latch.countDown();
+    }
+
     /** {@inheritDoc} */
     @Override protected boolean registerClassName(int id, String clsName) throws IgniteCheckedException {
         GridCacheAdapter<Integer, String> cache0 = cache;