IGNITE-10830 Return semantics of ServiceTopologyCallable - Fixes #5760.
authorVyacheslav Daradur <daradurvs@gmail.com>
Fri, 28 Dec 2018 07:43:44 +0000 (10:43 +0300)
committerAlexey Goncharuk <alexey.goncharuk@gmail.com>
Fri, 28 Dec 2018 12:16:35 +0000 (15:16 +0300)
Signed-off-by: Alexey Goncharuk <alexey.goncharuk@gmail.com>
modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java

index 8fcbe4a..bcdb8e5 100644 (file)
@@ -905,7 +905,7 @@ public class GridServiceProcessor extends ServiceProcessorAdapter implements Ign
 
         ClusterNode node = cache.affinity().mapKeyToNode(name);
 
-        final ServiceTopologyCallable call = new ServiceTopologyCallable(name, pendingJobCtxs);
+        final ServiceTopologyCallable call = new ServiceTopologyCallable(name);
 
         return ctx.closure().callAsyncNoFailover(
             GridClosureCallMode.BROADCAST,
@@ -2079,16 +2079,11 @@ public class GridServiceProcessor extends ServiceProcessorAdapter implements Ign
         @LoggerResource
         private transient IgniteLogger log;
 
-        /** */
-        private final List<ComputeJobContext> pendingCtxs;
-
         /**
          * @param svcName Service name.
-         * @param pendingCtxs Pending compute job contexts that waiting for utility cache initialization.
          */
-        public ServiceTopologyCallable(String svcName, List<ComputeJobContext> pendingCtxs) {
+        public ServiceTopologyCallable(String svcName) {
             this.svcName = svcName;
-            this.pendingCtxs = pendingCtxs;
         }
 
         /** {@inheritDoc} */
@@ -2096,6 +2091,8 @@ public class GridServiceProcessor extends ServiceProcessorAdapter implements Ign
             IgniteInternalCache<Object, Object> cache = ignite.context().cache().utilityCache();
 
             if (cache == null) {
+                List<ComputeJobContext> pendingCtxs = ((GridServiceProcessor)ignite.context().service()).pendingJobCtxs;
+
                 synchronized (pendingCtxs) {
                     // Double check cache reference after lock acqusition.
                     cache = ignite.context().cache().utilityCache();