Alexey Kukushkin created IGNITE-17276:
-----------------------------------------

             Summary: CompletableFuture#supplyAsync never completes with Ignite 
ExecutorService
                 Key: IGNITE-17276
                 URL: https://issues.apache.org/jira/browse/IGNITE-17276
             Project: Ignite
          Issue Type: Bug
          Components: compute
    Affects Versions: 2.13
            Reporter: Alexey Kukushkin


h3. Scenario: CompletableFuture#supplyAsync with Ignite ExecutorService

Given a cluster of two Ignite nodes
And Ignite {{ExecutorService}} for a remote node
When a task is executed using CompletableFuture#supplyAsync with the Ignite's 
{{ExecutorService}}
Then the task eventually completes

Actual result: the task never completes. Waiting on the task's future blocks 
forever.

Note; the scenario works fine if the task is executed on the local Ignite node.

{code:java}
public class Reproducer {
    @Test
    public void supplyIgniteExecutorToCompletableFuture() throws 
InterruptedException, ExecutionException {
        Function<String, IgniteConfiguration> igniteCfgFactory = igniteName -> 
new IgniteConfiguration()
            .setIgniteInstanceName(igniteName)
            .setDiscoverySpi(
                new TcpDiscoverySpi()
                    .setIpFinder(new 
TcpDiscoveryVmIpFinder().setAddresses(Collections.singleton("127.0.0.1:47500")))
            );

        try (var ignored = Ignition.start(igniteCfgFactory.apply("server"));
             final var ignite = Ignition.start(igniteCfgFactory.apply("app"))) {
            final var igniteExecutor = 
ignite.executorService(ignite.cluster().forRemotes());
            final var future = CompletableFuture.supplyAsync(new Task(), 
igniteExecutor);
            final var result = future.get();
            assertNotNull(result);
        }
    }

    private static class Task implements Supplier<String> {
        @Override public String get() {
            return UUID.randomUUID().toString();
        }
    }
}
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to