Pavel Pereslegin created IGNITE-23939:
-----------------------------------------
Summary: Sql. Script cancellation does not wait until all
subqueries are removed from the registry
Key: IGNITE-23939
URL: https://issues.apache.org/jira/browse/IGNITE-23939
Project: Ignite
Issue Type: Bug
Components: sql
Reporter: Pavel Pereslegin
The issue can be reproduced by adding an extra sleep() just before deleting the
query from the registry.
{code:java}
onPhaseStarted(ExecutionPhase.TERMINATED).whenComplete((ignored, ex) ->
{
Thread.sleep(500); // add extra sleep here
runningQueries.remove(id);
terminationDoneFuture.complete(null);
});
{code}
And run the following test (add it to ItCancelScriptTest)
{code:java}
@Test
void cancelScriptX() {
CancelHandle cancelHandle = CancelHandle.create();
CancellationToken token = cancelHandle.token();
AsyncSqlCursor<InternalSqlRow> cur = runScript(token,
"SELECT 1; SELECT 2; SELECT 3;"
);
Awaitility.await().untilAsserted(() ->
assertThat(queryProcessor().runningQueriesCount(), is(3 + /* SCRIPT */ 1)));
cancelHandle.cancel();
assertThat(queryProcessor().runningQueriesCount(), is(0));
}
{code}
we expecting that script cancellation will wait until all child queries will be
removed from the registry, but this test fails
{noformat}
java.lang.AssertionError:
Expected: is <0>
but: was <1>
Expected :is <0>
Actual :<1>
{noformat}
NOTE: the last query in the registry of running queries is usually "SELECT 1".
It is necessary to investigate the problem and fix it so that the parent query
is removed from the registry of running queries only after all child queries
are removed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)