This is an automated email from the ASF dual-hosted git repository.

NSAmelchev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new d289b1a56f1 IGNITE-29114 Fix chained distributed processes hang when 
the coordinator leaves between phases (#13659)
d289b1a56f1 is described below

commit d289b1a56f1cf5bf5ceafa78d0a3d871542103d3
Author: Nikita Amelchev <[email protected]>
AuthorDate: Mon Oct 12 13:27:36 2026 +0300

    IGNITE-29114 Fix chained distributed processes hang when the coordinator 
leaves between phases (#13659)
---
 .../managers/encryption/GridEncryptionManager.java |   4 +-
 .../managers/encryption/GroupKeyChangeProcess.java |   5 +-
 .../persistence/snapshot/SnapshotCheckProcess.java |   3 +-
 .../snapshot/SnapshotRestoreProcess.java           |  23 +--
 .../rollingupgrade/RollingUpgradeProcessor.java    |   4 +-
 .../util/distributed/DistributedProcess.java       |  55 +++++++
 .../internal/encryption/MasterKeyChangeTest.java   |  26 ++++
 .../DistributedProcessStartByCoordinatorTest.java  | 164 +++++++++++++++++++++
 .../ignite/testsuites/IgniteUtilSelfTestSuite.java |   2 +
 9 files changed, 262 insertions(+), 24 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java
index 9989036b610..980f62c99a1 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GridEncryptionManager.java
@@ -1537,8 +1537,8 @@ public class GridEncryptionManager extends 
GridManagerAdapter<EncryptionSpi> imp
 
             completeMasterKeyChangeFuture(id, err);
         }
-        else if (U.isLocalNodeCoordinator(ctx.discovery()))
-            performMKChangeProc.start(id, masterKeyChangeRequest);
+        else
+            performMKChangeProc.startByCoordinator(id, masterKeyChangeRequest);
     }
 
     /**
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GroupKeyChangeProcess.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GroupKeyChangeProcess.java
index 99a9ed1cdb5..18455ae82b9 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GroupKeyChangeProcess.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/encryption/GroupKeyChangeProcess.java
@@ -37,7 +37,6 @@ import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.T2;
 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;
 import org.apache.ignite.lang.IgniteFuture;
 import org.apache.ignite.lang.IgniteFutureCancelledException;
 import org.apache.ignite.plugin.extensions.communication.Message;
@@ -275,8 +274,8 @@ class GroupKeyChangeProcess {
 
             completeFuture(id, err, fut);
         }
-        else if (U.isLocalNodeCoordinator(ctx.discovery()))
-            performGKChangeProc.start(id, req);
+        else
+            performGKChangeProc.startByCoordinator(id, req);
     }
 
     /**
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java
index 533f3e1a44d..dd7ec0ef291 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java
@@ -581,8 +581,7 @@ public class SnapshotCheckProcess {
             if (clusterOpFut != null)
                 ctx.clusterMetas = metas;
 
-            if (U.isLocalNodeCoordinator(kctx.discovery()))
-                phase2PartsHashes.start(reqId, ctx.req);
+            phase2PartsHashes.startByCoordinator(reqId, ctx.req);
         }
         catch (Throwable th) {
             if (ctx != null) {
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
index 77f56f4d4cc..43db339d103 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
@@ -860,8 +860,7 @@ public class SnapshotRestoreProcess {
 
         opCtx0.cfgs = globalCfgs;
 
-        if (U.isLocalNodeCoordinator(ctx.discovery()))
-            preloadProc.start(reqId, new SnapshotRestoreStartRequest(reqId));
+        preloadProc.startByCoordinator(reqId, new 
SnapshotRestoreStartRequest(reqId));
     }
 
     /**
@@ -1249,14 +1248,12 @@ public class SnapshotRestoreProcess {
         opCtx0.errHnd.accept(failure);
 
         if (failure != null) {
-            if (U.isLocalNodeCoordinator(ctx.discovery()))
-                rollbackRestoreProc.start(reqId, new 
SnapshotRestoreStartRequest(reqId));
+            rollbackRestoreProc.startByCoordinator(reqId, new 
SnapshotRestoreStartRequest(reqId));
 
             return;
         }
 
-        if (U.isLocalNodeCoordinator(ctx.discovery()))
-            cacheStartProc.start(reqId, new 
SnapshotRestoreStartRequest(reqId));
+        cacheStartProc.startByCoordinator(reqId, new 
SnapshotRestoreStartRequest(reqId));
     }
 
     /**
@@ -1312,8 +1309,7 @@ public class SnapshotRestoreProcess {
 
         if (failure == null) {
             if (opCtx0.incIdx > 0) {
-                if (U.isLocalNodeCoordinator(ctx.discovery()))
-                    incSnpRestoreProc.start(reqId, new 
SnapshotRestoreStartRequest(reqId));
+                incSnpRestoreProc.startByCoordinator(reqId, new 
SnapshotRestoreStartRequest(reqId));
 
                 return;
             }
@@ -1325,8 +1321,7 @@ public class SnapshotRestoreProcess {
 
         opCtx0.err.compareAndSet(null, failure);
 
-        if (U.isLocalNodeCoordinator(ctx.discovery()))
-            cacheStopProc.start(reqId, new SnapshotRestoreStartRequest(reqId));
+        cacheStopProc.startByCoordinator(reqId, new 
SnapshotRestoreStartRequest(reqId));
     }
 
     /**
@@ -1337,7 +1332,7 @@ public class SnapshotRestoreProcess {
         if (!U.isLocalNodeCoordinator(ctx.discovery()))
             return new GridFinishedFuture<>();
 
-        assert opCtx.reqId == req.requestId();
+        assert opCtx.reqId.equals(req.requestId());
 
         SnapshotRestoreContext opCtx0 = opCtx;
 
@@ -1374,8 +1369,7 @@ public class SnapshotRestoreProcess {
             log.error("Failed to stop caches during a snapshot rollback 
routine [reqId=" + opCtx0.reqId + ", err=" + errs + ']');
         }
 
-        if (U.isLocalNodeCoordinator(ctx.discovery()))
-            rollbackRestoreProc.start(reqId, new 
SnapshotRestoreStartRequest(reqId));
+        rollbackRestoreProc.startByCoordinator(reqId, new 
SnapshotRestoreStartRequest(reqId));
     }
 
     /**
@@ -1576,8 +1570,7 @@ public class SnapshotRestoreProcess {
 
         opCtx0.err.compareAndSet(null, failure);
 
-        if (U.isLocalNodeCoordinator(ctx.discovery()))
-            cacheStopProc.start(reqId, new SnapshotRestoreStartRequest(reqId));
+        cacheStopProc.startByCoordinator(reqId, new 
SnapshotRestoreStartRequest(reqId));
     }
 
     /**
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/rollingupgrade/RollingUpgradeProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rollingupgrade/RollingUpgradeProcessor.java
index 690b1f29521..f8538bcbfbe 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/rollingupgrade/RollingUpgradeProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rollingupgrade/RollingUpgradeProcessor.java
@@ -535,8 +535,8 @@ public class RollingUpgradeProcessor extends 
GridProcessorAdapter implements Dis
 
                 finishProcess(reqId, firstError(errors));
             }
-            else if (reqId.equals(curFinalizeProcId) && 
U.isLocalNodeCoordinator(ctx.discovery()))
-                completePhase.start(reqId, null);
+            else if (reqId.equals(curFinalizeProcId))
+                completePhase.startByCoordinator(reqId, null);
         }
 
         /** */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/distributed/DistributedProcess.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/distributed/DistributedProcess.java
index 3d0ce062f4f..dcbd07fac68 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/distributed/DistributedProcess.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/distributed/DistributedProcess.java
@@ -41,6 +41,7 @@ import org.apache.ignite.internal.util.typedef.CI3;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.spi.discovery.IgniteDiscoveryThread;
 import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
@@ -62,6 +63,8 @@ import static 
org.apache.ignite.internal.util.lang.ClusterNodeFunc.node2id;
  * </ol>
  * <p>
  * Several processes of one type can be started at the same time.
+ * <p>
+ * Processes can be chained: the finish closure starts the next process via 
{@link #startByCoordinator(UUID, Message)}.
  *
  * @param <I> Request type.
  * @param <R> Result type.
@@ -75,6 +78,9 @@ public class DistributedProcess<I extends Message, R extends 
Message> {
     /** Active processes. */
     private final ConcurrentHashMap<UUID, Process> processes = new 
ConcurrentHashMap<>(1);
 
+    /** Start requests to run when the local node becomes the coordinator, see 
{@link #startByCoordinator}. */
+    private final ConcurrentHashMap<UUID, Runnable> pendingStartRequests = new 
ConcurrentHashMap<>(1);
+
     /** Synchronization mutex for coordinator initializing and the remaining 
collection operations. */
     private final Object mux = new Object();
 
@@ -126,6 +132,8 @@ public class DistributedProcess<I extends Message, R 
extends Message> {
             if (msg.type() != type.ordinal())
                 return;
 
+            pendingStartRequests.remove(msg.processId());
+
             Process p = processes.computeIfAbsent(msg.processId(), id -> new 
Process(msg.processId()));
 
             // May be completed in case of double delivering.
@@ -215,6 +223,8 @@ public class DistributedProcess<I extends Message, R 
extends Message> {
         ctx.event().addDiscoveryEventListener((evt, discoCache) -> {
             UUID leftNodeId = evt.eventNode().id();
 
+            startPendingRequests();
+
             for (Process p : processes.values()) {
                 p.initFut.listen(() -> {
                     if (Objects.equals(leftNodeId, p.crdId)) {
@@ -265,6 +275,50 @@ public class DistributedProcess<I extends Message, R 
extends Message> {
         }
     }
 
+    /**
+     * Starts the process by the coordinator: it sends the initial request, 
and if it leaves before the request is
+     * delivered, the next coordinator sends it. Must be called on every 
server node while handling the same discovery
+     * event, e.g. from the finish closure of the previous process, so that 
the call precedes the initial request
+     * delivery.
+     *
+     * @param id Process id.
+     * @param req Initial request.
+     */
+    public void startByCoordinator(UUID id, I req) {
+        if (ctx.clientNode())
+            return;
+
+        assert Thread.currentThread() instanceof IgniteDiscoveryThread : "Must 
be called from the discovery thread";
+
+        ClusterNode crd = coordinator();
+
+        if (crd == null)
+            return;
+
+        if (crd.isLocal())
+            start(id, req);
+        else
+            pendingStartRequests.put(id, () -> start(id, req));
+    }
+
+    /** Runs the pending start requests if the local node has become the 
coordinator. */
+    private void startPendingRequests() {
+        if (pendingStartRequests.isEmpty())
+            return;
+
+        ClusterNode crd = coordinator();
+
+        if (crd == null || !crd.isLocal())
+            return;
+
+        for (UUID id : pendingStartRequests.keySet()) {
+            Runnable start = pendingStartRequests.remove(id);
+
+            if (start != null)
+                start.run();
+        }
+    }
+
     /**
      * Initiates process coordinator.
      *
@@ -373,6 +427,7 @@ public class DistributedProcess<I extends Message, R 
extends Message> {
     /** Handles case when all server nodes have left the grid. */
     private void onAllServersLeft() {
         processes.clear();
+        pendingStartRequests.clear();
     }
 
     /** @return Cluster coordinator, {@code null} if failed to determine. */
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/encryption/MasterKeyChangeTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/encryption/MasterKeyChangeTest.java
index 5df474911e0..0266d91058f 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/encryption/MasterKeyChangeTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/encryption/MasterKeyChangeTest.java
@@ -28,6 +28,7 @@ import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.cluster.ClusterState;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.DiscoverySpiTestListener;
 import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.TestRecordingCommunicationSpi;
@@ -35,9 +36,11 @@ import 
org.apache.ignite.internal.managers.encryption.GenerateEncryptionKeyRespo
 import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
 import 
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager;
 import 
org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage;
+import org.apache.ignite.internal.util.distributed.InitMessage;
 import org.apache.ignite.internal.util.distributed.SingleNodeMessage;
 import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.lang.IgniteFuture;
+import 
org.apache.ignite.spi.discovery.tcp.IgniteDiscoverySpiInternalListenerSupport;
 import org.apache.ignite.transactions.Transaction;
 import org.junit.Test;
 
@@ -422,6 +425,29 @@ public class MasterKeyChangeTest extends 
AbstractEncryptionTest {
         assertEquals(MASTER_KEY_NAME_2, 
aliveNode.encryption().getMasterKeyName());
     }
 
+    /** Coordinator fails after the prepare phase is finished and before it 
starts the perform phase. */
+    @Test
+    public void testCoordinatorFailsBetweenPrepareAndPerform() throws 
Exception {
+        T2<IgniteEx, IgniteEx> grids = startTestGrids(true);
+
+        DiscoverySpiTestListener lsnr = new DiscoverySpiTestListener();
+
+        
((IgniteDiscoverySpiInternalListenerSupport)grids.get1().configuration().getDiscoverySpi())
+            .setInternalListener(lsnr);
+
+        lsnr.blockCustomEvent(InitMessage.class);
+
+        IgniteFuture<Void> fut = 
grids.get2().encryption().changeMasterKey(MASTER_KEY_NAME_2);
+
+        lsnr.waitCustomEvent();
+
+        stopGrid(GRID_0, true);
+
+        fut.get(getTestTimeout());
+
+        assertEquals(MASTER_KEY_NAME_2, 
grids.get2().encryption().getMasterKeyName());
+    }
+
     /** @throws Exception If failed. */
     @Test
     public void testMultiByteMasterKeyNameWalRecovery() throws Exception {
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/util/distributed/DistributedProcessStartByCoordinatorTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/util/distributed/DistributedProcessStartByCoordinatorTest.java
new file mode 100644
index 00000000000..82c125b5641
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/util/distributed/DistributedProcessStartByCoordinatorTest.java
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.distributed;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.DiscoverySpiTestListener;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.future.GridFinishedFuture;
+import org.apache.ignite.internal.util.future.GridFutureAdapter;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.MessagesPluginProvider;
+import 
org.apache.ignite.spi.discovery.tcp.IgniteDiscoverySpiInternalListenerSupport;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.TEST_PROCESS;
+
+/**
+ * Tests {@link DistributedProcess#startByCoordinator} in case of coordinator 
node left.
+ */
+public class DistributedProcessStartByCoordinatorTest extends 
GridCommonAbstractTest {
+    /** Nodes count. */
+    private static final int NODES_CNT = 3;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+        cfg.setPluginProviders(new 
MessagesPluginProvider(TestIntegerMessage.class));
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() {
+        stopAllGrids();
+    }
+
+    /** Coordinator fails after the first process is finished and before it 
sends the initial request of the next one. */
+    @Test
+    public void testCoordinatorFailsBetweenProcesses() throws Exception {
+        startGrids(NODES_CNT);
+
+        DiscoverySpiTestListener lsnr = new DiscoverySpiTestListener();
+
+        
((IgniteDiscoverySpiInternalListenerSupport)grid(0).configuration().getDiscoverySpi()).setInternalListener(lsnr);
+
+        lsnr.blockCustomEvent(InitMessage.class);
+
+        CountDownLatch finishLatch = new CountDownLatch(NODES_CNT - 1);
+
+        // The first process starts the next one with the same id, the request 
value is the process number.
+        Map<String, DistributedProcess<TestIntegerMessage, 
TestIntegerMessage>> procByNode = new HashMap<>();
+
+        for (Ignite grid : G.allGrids()) {
+            procByNode.put(grid.name(), new DistributedProcess<>(
+                ((IgniteEx)grid).context(),
+                TEST_PROCESS,
+                (ignored, req) -> new GridFinishedFuture<>(req),
+                (id, res, err) -> {
+                    if (res.size() == NODES_CNT && 
res.values().stream().allMatch(msg -> msg.value() == 1))
+                        procByNode.get(grid.name()).startByCoordinator(id, new 
TestIntegerMessage(2));
+                    else if (res.size() == NODES_CNT - 1 && 
res.values().stream().allMatch(msg -> msg.value() == 2))
+                        finishLatch.countDown();
+                    else
+                        fail("Unexpected process result [res=" + res + ", 
err=" + err + ']');
+                }));
+        }
+
+        procByNode.get(grid(1).name()).start(UUID.randomUUID(), new 
TestIntegerMessage(1));
+
+        lsnr.waitCustomEvent();
+
+        stopGrid(0);
+
+        assertTrue(finishLatch.await(getTestTimeout(), MILLISECONDS));
+    }
+
+    /**
+     * Coordinator fails after the initial request of the next process is 
delivered, so the next coordinator must not
+     * send it again.
+     */
+    @Test
+    public void testCoordinatorFailsAfterNextProcessStarted() throws Exception 
{
+        startGrids(NODES_CNT);
+
+        // Initial requests sent by the next coordinator.
+        AtomicInteger initMsgs = new AtomicInteger();
+
+        
((IgniteDiscoverySpiInternalListenerSupport)grid(1).configuration().getDiscoverySpi()).setInternalListener(
+            (spi, log, msg) -> {
+                if (U.unwrapCustomMessage(msg) instanceof InitMessage)
+                    initMsgs.incrementAndGet();
+
+                return true;
+            });
+
+        CountDownLatch nextProcStarted = new CountDownLatch(NODES_CNT);
+        CountDownLatch finishLatch = new CountDownLatch(NODES_CNT - 1);
+
+        // The next process is in progress while the coordinator leaves, so it 
finishes on the new coordinator after
+        // the node left is handled there and the counter is final.
+        GridFutureAdapter<TestIntegerMessage> nextProcRes = new 
GridFutureAdapter<>();
+
+        Map<String, DistributedProcess<TestIntegerMessage, 
TestIntegerMessage>> procByNode = new HashMap<>();
+
+        for (Ignite grid : G.allGrids()) {
+            procByNode.put(grid.name(), new DistributedProcess<>(
+                ((IgniteEx)grid).context(),
+                TEST_PROCESS,
+                (ignored, req) -> {
+                    if (req.value() == 1)
+                        return new GridFinishedFuture<>(req);
+
+                    nextProcStarted.countDown();
+
+                    return nextProcRes;
+                },
+                (id, res, err) -> {
+                    if (res.size() == NODES_CNT && 
res.values().stream().allMatch(msg -> msg.value() == 1))
+                        procByNode.get(grid.name()).startByCoordinator(id, new 
TestIntegerMessage(2));
+                    else if (res.size() == NODES_CNT - 1 && 
res.values().stream().allMatch(msg -> msg.value() == 2))
+                        finishLatch.countDown();
+                    else
+                        fail("Unexpected process result [res=" + res + ", 
err=" + err + ']');
+                }));
+        }
+
+        procByNode.get(grid(0).name()).start(UUID.randomUUID(), new 
TestIntegerMessage(1));
+
+        assertTrue(nextProcStarted.await(getTestTimeout(), MILLISECONDS));
+
+        stopGrid(0);
+
+        nextProcRes.onDone(new TestIntegerMessage(2));
+
+        assertTrue(finishLatch.await(getTestTimeout(), MILLISECONDS));
+
+        assertEquals(0, initMsgs.get());
+    }
+}
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
index ad2129d4d2e..c998accb81f 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java
@@ -37,6 +37,7 @@ import 
org.apache.ignite.internal.util.distributed.DistributedProcessClientAwait
 import 
org.apache.ignite.internal.util.distributed.DistributedProcessCoordinatorLeftTest;
 import 
org.apache.ignite.internal.util.distributed.DistributedProcessErrorHandlingTest;
 import 
org.apache.ignite.internal.util.distributed.DistributedProcessResultMarshallingTest;
+import 
org.apache.ignite.internal.util.distributed.DistributedProcessStartByCoordinatorTest;
 import org.apache.ignite.internal.util.nio.GridNioDelimitedBufferSelfTest;
 import org.apache.ignite.internal.util.nio.GridNioSelfTest;
 import org.apache.ignite.internal.util.nio.GridNioServerTest;
@@ -147,6 +148,7 @@ import org.junit.runners.Suite;
 
     DistributedProcessErrorHandlingTest.class,
     DistributedProcessCoordinatorLeftTest.class,
+    DistributedProcessStartByCoordinatorTest.class,
     DistributedProcessClientAwaitTest.class,
     DistributedProcessResultMarshallingTest.class,
 

Reply via email to