ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [04/10] ignite git commit: ignite-5549 : Clear MvccManager.pending queue after AsyncOp.op(...). - Fixes #2626.
Date Thu, 14 Sep 2017 14:41:04 GMT
ignite-5549 : Clear MvccManager.pending queue after AsyncOp.op(...). - Fixes #2626.

Signed-off-by: Alexey Goncharuk <alexey.goncharuk@gmail.com>


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

Branch: refs/heads/ignite-5896
Commit: 9514d4a6b80becde2cea69afdb570e789bf47949
Parents: 1d95e52
Author: Ilya Lantukh <ilantukh@gridgain.com>
Authored: Wed Sep 13 19:13:46 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Sep 13 19:13:46 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 87 ++++++++++++--------
 1 file changed, 51 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9514d4a6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 8e346ba..fb6d097 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -4200,29 +4200,36 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
                                 return new GridFinishedFuture<>(
                                     new IgniteCheckedException("Operation has been cancelled
(node is stopping)."));
 
-                            return op.op(tx0, opCtx).chain(new CX1<IgniteInternalFuture<T>,
T>() {
-                                @Override public T applyx(IgniteInternalFuture<T> tFut)
throws IgniteCheckedException {
-                                    try {
-                                        return tFut.get();
-                                    }
-                                    catch (IgniteTxRollbackCheckedException e) {
-                                        throw e;
-                                    }
-                                    catch (IgniteCheckedException e1) {
+                            try {
+                                return op.op(tx0, opCtx).chain(new CX1<IgniteInternalFuture<T>,
T>() {
+                                    @Override
+                                    public T applyx(IgniteInternalFuture<T> tFut) throws
IgniteCheckedException {
                                         try {
-                                            tx0.rollbackNearTxLocalAsync();
+                                            return tFut.get();
                                         }
-                                        catch (Throwable e2) {
-                                            e1.addSuppressed(e2);
+                                        catch (IgniteTxRollbackCheckedException e) {
+                                            throw e;
                                         }
+                                        catch (IgniteCheckedException e1) {
+                                            try {
+                                                tx0.rollbackNearTxLocalAsync();
+                                            }
+                                            catch (Throwable e2) {
+                                                e1.addSuppressed(e2);
+                                            }
 
-                                        throw e1;
-                                    }
-                                    finally {
-                                        ctx.shared().txContextReset();
+                                            throw e1;
+                                        }
+                                        finally {
+                                            ctx.shared().txContextReset();
+                                        }
                                     }
-                                }
-                            });
+                                });
+                            }
+                            finally {
+                                // It is necessary to clear tx context in this thread as
well.
+                                ctx.shared().txContextReset();
+                            }
                         }
                     });
 
@@ -4231,29 +4238,37 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
                 return f;
             }
 
-            final IgniteInternalFuture<T> f = op.op(tx, opCtx).chain(new CX1<IgniteInternalFuture<T>,
T>() {
-                @Override public T applyx(IgniteInternalFuture<T> tFut) throws IgniteCheckedException
{
-                    try {
-                        return tFut.get();
-                    }
-                    catch (IgniteTxRollbackCheckedException e) {
-                        throw e;
-                    }
-                    catch (IgniteCheckedException e1) {
+            IgniteInternalFuture<T> f;
+
+            try {
+                f = op.op(tx, opCtx).chain(new CX1<IgniteInternalFuture<T>, T>()
{
+                    @Override public T applyx(IgniteInternalFuture<T> tFut) throws
IgniteCheckedException {
                         try {
-                            tx0.rollbackNearTxLocalAsync();
+                            return tFut.get();
                         }
-                        catch (Throwable e2) {
-                            e1.addSuppressed(e2);
+                        catch (IgniteTxRollbackCheckedException e) {
+                            throw e;
                         }
+                        catch (IgniteCheckedException e1) {
+                            try {
+                                tx0.rollbackNearTxLocalAsync();
+                            }
+                            catch (Throwable e2) {
+                                e1.addSuppressed(e2);
+                            }
 
-                        throw e1;
-                    }
-                    finally {
-                        ctx.shared().txContextReset();
+                            throw e1;
+                        }
+                        finally {
+                            ctx.shared().txContextReset();
+                        }
                     }
-                }
-            });
+                });
+            }
+            finally {
+                // It is necessary to clear tx context in this thread as well.
+                ctx.shared().txContextReset();
+            }
 
             saveFuture(holder, f, retry);
 


Mime
View raw message