Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-task-hang [created] 919080219


# ignite-task-hang debug


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

Branch: refs/heads/ignite-task-hang
Commit: 919080219fe994f87f0e75db32efe216af287bfd
Parents: 51d32fc
Author: sboikov <sboi...@gridgain.com>
Authored: Thu May 21 16:09:39 2015 +0300
Committer: sboikov <sboi...@gridgain.com>
Committed: Thu May 21 16:09:39 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheAdapter.java    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/91908021/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 8d7b135..e34d3c3 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
@@ -5510,7 +5510,8 @@ public abstract class GridCacheAdapter<K, V> implements 
IgniteInternalCache<K, V
 
         /** {@inheritDoc} */
         @Nullable @Override public final Object execute() {
-            waitAffinityReadyFuture();
+            if (!waitAffinityReadyFuture())
+                return null;
 
             IgniteInternalCache cache = 
((IgniteKernal)ignite).context().cache().cache(cacheName);
 
@@ -5525,8 +5526,10 @@ public abstract class GridCacheAdapter<K, V> implements 
IgniteInternalCache<K, V
 
         /**
          * Holds (suspends) job execution until our cache version becomes 
equal to remote cache's version.
+         *
+         * @return {@code True} if topology check passed.
          */
-        private void waitAffinityReadyFuture() {
+        private boolean waitAffinityReadyFuture() {
             GridCacheProcessor cacheProc = 
((IgniteKernal)ignite).context().cache();
 
             AffinityTopologyVersion locTopVer = 
cacheProc.context().exchange().readyAffinityVersion();
@@ -5535,15 +5538,19 @@ public abstract class GridCacheAdapter<K, V> implements 
IgniteInternalCache<K, V
                 IgniteInternalFuture<?> fut = 
cacheProc.context().exchange().affinityReadyFuture(topVer);
 
                 if (fut != null && !fut.isDone()) {
+                    jobCtx.holdcc();
+
                     fut.listen(new CI1<IgniteInternalFuture<?>>() {
                         @Override public void apply(IgniteInternalFuture<?> t) 
{
                             jobCtx.callcc();
                         }
                     });
 
-                    jobCtx.holdcc();
+                    return false;
                 }
             }
+
+            return true;
         }
     }
 

Reply via email to