ignite-5549 : Clear MvccManager.pending queue after AsyncOp.op(...). - Fixes
@@ -4200,8 +4200,10 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
return new GridFinishedFuture<>(
new IgniteCheckedException("Operation has been cancelled (node is stopping)."));
+ try {
return op.op(tx0, opCtx).chain(new CX1<IgniteInternalFuture<T>, T>() {
- @Override public T applyx(IgniteInternalFuture<T> tFut) throws IgniteCheckedException {
+ @Override
+ public T applyx(IgniteInternalFuture<T> tFut) throws IgniteCheckedException {
try {
return tFut.get();
}
@@ -4224,6 +4226,11 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
});
}
+ finally {
+ // It is necessary to clear tx context in this thread as well.
+ ctx.shared().txContextReset();
+ }
+ }
});
saveFuture(holder, f, retry);
@@ -4231,7 +4238,10 @@ 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>() {
+ 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 {
return tFut.get();
@@ -4254,6 +4264,11 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
}
});
+ }
+ finally {
+ // It is necessary to clear tx context in this thread as well.
+ ctx.shared().txContextReset();
+ }
saveFuture(holder, f, retry);
