Details
Description
KILL QUERY doesn't close already fetched cursor.
Reproducer:
public void testCancelSQLQuery() throws Exception { startGrids(NODES_CNT); IgniteEx client = startClientGrid("client"); client.cluster().state(ACTIVE); IgniteCache<Object, Object> cache = client.getOrCreateCache( new CacheConfiguration<>(DEFAULT_CACHE_NAME).setIndexedTypes(Integer.class, Integer.class)); for (int i = 0; i < PAGE_SZ * PAGE_SZ; i++) cache.put(i, i); SqlFieldsQuery qry = new SqlFieldsQuery("SELECT _KEY, _VAL FROM INTEGER").setSchema("default").setPageSize(10); Iterator<List<?>> iter = queryProcessor(client).querySqlFields(qry, true).iterator(); assertNotNull(iter.next()); List<List<?>> sqlQries = SqlViewExporterSpiTest.execute(client, "SELECT * FROM SYS.SQL_QUERIES ORDER BY START_TIME"); assertEquals(2, sqlQries.size()); String qryId = (String)sqlQries.get(0).get(0); assertEquals("SELECT _KEY, _VAL FROM INTEGER", sqlQries.get(0).get(1)); SqlViewExporterSpiTest.execute(client, "KILL QUERY '" + qryId + "'"); while(iter.hasNext()) assertNotNull(iter.next()); fail("You shouldn't be here!"); //Fails here for now. but should fails on iter.next call.
Attachments
Issue Links
- relates to
-
IGNITE-12732 SQL: KILL QUERY command hangs on query when query cursor is held by user or leak
- Resolved
-
IGNITE-12632 [IEP-39] Management API to cancel user provided tasks and queries.
- Resolved