Evgeny Stanilovsky created IGNITE-23688:
-------------------------------------------
Summary: Compute execution assertion in embedded mode
Key: IGNITE-23688
URL: https://issues.apache.org/jira/browse/IGNITE-23688
Project: Ignite
Issue Type: Bug
Components: compute
Affects Versions: 3.0.0-beta1
Reporter: Evgeny Stanilovsky
I failed to run near test in embedded mode:
append into ItComputeBaseTest
{code:java}
@ParameterizedTest(name = "local: {0}")
@ValueSource(booleans = {true, false})
void cancelComputeSubmitWithCancelHandle(boolean local) {
Ignite entryNode = node(0);
Ignite executeNode = local ? node(0) : node(1);
JobDescriptor<Long, Void> job =
JobDescriptor.builder(SilentSleepJob.class)
.options(executionOptions).units(units()).build();
JobExecution<Void> execution =
entryNode.compute().submit(JobTarget.node(clusterNode(executeNode)), job, 100L);
await().atMost(10, TimeUnit.SECONDS).until(() ->
execution.cancelAsync().isDone());
await().atMost(10, TimeUnit.SECONDS).until(() ->
execution.resultAsync().isDone());
}
{code}
and
into : package org.apache.ignite.internal.compute
{code:java}
public class SilentSleepJob implements ComputeJob<Long, Void> {
@Override
public CompletableFuture<Void> executeAsync(JobExecutionContext
jobExecutionContext, Long timeout) {
try {
TimeUnit.SECONDS.sleep(timeout);
} catch (InterruptedException e) {
// no op.
}
return null;
}
}
{code}
got:
{noformat}
org.apache.ignite.internal.compute.state.IllegalJobStatusTransition: Failed to
transition job b692660b-e3ec-4749-80b8-ef1f39d9b7d7 from status CANCELED to
status CANCELING
at
org.apache.ignite.internal.compute.state.InMemoryComputeStateMachine.lambda$cancelingJob$0(InMemoryComputeStateMachine.java:124)
~[main/:?]
at
org.apache.ignite.internal.compute.state.InMemoryComputeStateMachine.lambda$changeJobStatus$2(InMemoryComputeStateMachine.java:141)
~[main/:?]
at
org.apache.ignite.internal.compute.state.InMemoryComputeStateMachine.lambda$changeStatus$3(InMemoryComputeStateMachine.java:158)
~[main/:?]
at
java.base/java.util.concurrent.ConcurrentHashMap.computeIfPresent(ConcurrentHashMap.java:1822)
~[?:?]
at
org.apache.ignite.internal.compute.state.InMemoryComputeStateMachine.changeStatus(InMemoryComputeStateMachine.java:158)
~[main/:?]
at
org.apache.ignite.internal.compute.state.InMemoryComputeStateMachine.changeJobStatus(InMemoryComputeStateMachine.java:139)
~[main/:?]
at
org.apache.ignite.internal.compute.state.InMemoryComputeStateMachine.cancelingJob(InMemoryComputeStateMachine.java:116)
~[main/:?]
at
org.apache.ignite.internal.compute.queue.QueueExecutionImpl.cancel(QueueExecutionImpl.java:94)
~[main/:?]
at
org.apache.ignite.internal.compute.executor.JobExecutionInternal.cancel(JobExecutionInternal.java:68)
~[main/:?]
at
java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:680)
~[?:?]
at
java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658)
~[?:?]
at
java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2100)
~[?:?]
at
org.apache.ignite.internal.compute.DelegatingJobExecution.cancelAsync(DelegatingJobExecution.java:52)
~[main/:?]
at
org.apache.ignite.internal.compute.ExecutionManager.cancelAsync(ExecutionManager.java:148)
~[main/:?]
{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)