Repository: ignite Updated Branches: refs/heads/ignite-1537 d29395e62 -> 1daab5327
ignite-2146 Avoid hang in 'cache.get' if topology locked. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/1daab532 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/1daab532 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/1daab532 Branch: refs/heads/ignite-1537 Commit: 1daab5327a367498af1fa9b8081d1a76ea4d3b1b Parents: d29395e Author: sboikov <[email protected]> Authored: Wed Dec 16 15:56:10 2015 +0300 Committer: sboikov <[email protected]> Committed: Wed Dec 16 15:56:10 2015 +0300 ---------------------------------------------------------------------- .../distributed/near/GridNearLockFuture.java | 23 +++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/1daab532/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java index a90058a..1471795 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java @@ -56,8 +56,10 @@ import org.apache.ignite.internal.util.future.GridEmbeddedFuture; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.tostring.GridToStringInclude; +import org.apache.ignite.internal.util.typedef.C1; import org.apache.ignite.internal.util.typedef.C2; import org.apache.ignite.internal.util.typedef.CI1; +import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; @@ -678,7 +680,22 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean /** {@inheritDoc} */ @Override public String toString() { - return S.toString(GridNearLockFuture.class, this, "inTx", inTx(), "super", super.toString()); + Collection<String> futs = F.viewReadOnly(futures(), new C1<IgniteInternalFuture<?>, String>() { + @Override public String apply(IgniteInternalFuture<?> f) { + if (isMini(f)) { + MiniFuture m = (MiniFuture)f; + + return "[node=" + m.node().id() + ", loc=" + m.node().isLocal() + ", done=" + f.isDone() + "]"; + } + else + return "[loc=true, done=" + f.isDone() + "]"; + } + }); + + return S.toString(GridNearLockFuture.class, this, + "innerFuts", futs, + "inTx", inTx(), + "super", super.toString()); } /** @@ -1275,8 +1292,6 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean cctx.io().send(node, req, cctx.ioPolicy()); } catch (ClusterTopologyCheckedException ex) { - assert fut != null; - fut.onResult(ex); } } @@ -1290,8 +1305,6 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture<Boolean cctx.io().send(node, req, cctx.ioPolicy()); } catch (ClusterTopologyCheckedException ex) { - assert fut != null; - fut.onResult(ex); } catch (IgniteCheckedException e) {
