Skip to content

IGNITE-27873 Fix flaky IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest related tests#12749

Open
zstan wants to merge 1 commit intoapache:masterfrom
zstan:ignite-27873
Open

IGNITE-27873 Fix flaky IgniteCacheQueryStopOnCancelOrTimeoutDistributedJoinSelfTest related tests#12749
zstan wants to merge 1 commit intoapache:masterfrom
zstan:ignite-27873

Conversation

@zstan
Copy link
Contributor

@zstan zstan commented Feb 17, 2026

No description provided.

@zstan zstan force-pushed the ignite-27873 branch 2 times, most recently from 5f9ba6b to aa4d6ed Compare February 17, 2026 08:13
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 New Code Smells (required ≤ 1)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

private void testQueryCancel(Ignite ignite, String cacheName, String sql, int timeoutUnits, TimeUnit timeUnit,
boolean timeout, boolean checkCanceled) throws Exception {
SqlFieldsQuery qry = new SqlFieldsQuery(sql).setDistributedJoins(true);
SqlFieldsQuery qry = new SqlFieldsQuery(sql).setDistributedJoins(true);;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant ;

Comment on lines +110 to +113
int resSize = 0;
for (List<?> ignored1 : cursor) {
++resSize;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int resSize = F.size(cursor.iterator());?

Comment on lines 138 to 139
ConcurrentMap<UUID, ?> map = U.field(((IgniteH2Indexing)U.field((GridProcessor)U.field(
grid.context(), "qryProc"), "idx")).mapQueryExecutor(), "qryRess");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fix this mess too:

            ConcurrentMap<UUID, ?> map = U.field(
                ((IgniteH2Indexing)grid(0).context().query().getIndexing()).mapQueryExecutor(), "qryRess");

try (QueryCursor<List<?>> ignored = cursor) {
cursor.getAll();
int resSize = 0;
for (List<?> ignored1 : cursor) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testCancel3 fails sometimes here locally:

org.apache.ignite.IgniteException: The query was cancelled while executing.
	at org.apache.ignite.internal.util.lang.GridIteratorAdapter.next(GridIteratorAdapter.java:38)
	at org.apache.ignite.internal.processors.query.GridQueryCacheObjectsIterator.next(GridQueryCacheObjectsIterator.java:67)
	at org.apache.ignite.internal.processors.query.GridQueryCacheObjectsIterator.next(GridQueryCacheObjectsIterator.java:31)
	at org.apache.ignite.internal.processors.cache.QueryCursorImpl$LazyIterator.next(QueryCursorImpl.java:287)
	at org.apache.ignite.internal.processors.query.h2.RegisteredQueryCursor$RegisteredIterator.next(RegisteredQueryCursor.java:181)

It happens when query cancelled during fetch (after iterator() call and before all result processed). Exception was wrapped to IgniteException, but CacheException expected.


/** */
private static final int PURCHASE_CNT = 6_000;
private static final int PURCHASE_CNT = 24_000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still looks fragile. On fast environment we will again face this problem. Maybe use functions to guarantee long time execution (sleep, latch)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments