From cfabdc17f669e982ac9d1a569936350c724de056 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 8 Jun 2026 13:15:37 -0700 Subject: [PATCH 1/4] Added clearSession to operation settings and use non session settings to kill query --- .../client/api/command/CommandSettings.java | 5 + .../client/api/insert/InsertSettings.java | 6 + .../client/api/internal/CommonSettings.java | 6 + .../client/api/query/QuerySettings.java | 5 + .../com/clickhouse/jdbc/StatementImpl.java | 6 +- .../com/clickhouse/jdbc/StatementTest.java | 123 +++++++++++++++++- 6 files changed, 149 insertions(+), 2 deletions(-) diff --git a/client-v2/src/main/java/com/clickhouse/client/api/command/CommandSettings.java b/client-v2/src/main/java/com/clickhouse/client/api/command/CommandSettings.java index 399a50f26..e0780b4fa 100644 --- a/client-v2/src/main/java/com/clickhouse/client/api/command/CommandSettings.java +++ b/client-v2/src/main/java/com/clickhouse/client/api/command/CommandSettings.java @@ -33,4 +33,9 @@ public CommandSettings use(Session session) { super.use(session); return this; } + + public CommandSettings clearSession() { + super.clearSession(); + return this; + } } diff --git a/client-v2/src/main/java/com/clickhouse/client/api/insert/InsertSettings.java b/client-v2/src/main/java/com/clickhouse/client/api/insert/InsertSettings.java index 840e33889..cf50c1ab6 100644 --- a/client-v2/src/main/java/com/clickhouse/client/api/insert/InsertSettings.java +++ b/client-v2/src/main/java/com/clickhouse/client/api/insert/InsertSettings.java @@ -4,6 +4,7 @@ import com.clickhouse.client.api.ClientConfigProperties; import com.clickhouse.client.api.Session; import com.clickhouse.client.api.internal.CommonSettings; +import com.clickhouse.client.api.query.QuerySettings; import org.apache.hc.core5.http.HttpHeaders; import java.time.temporal.ChronoUnit; @@ -145,6 +146,11 @@ public InsertSettings use(Session session) { return this; } + public InsertSettings clearSession() { + settings.clearSession(); + return this; + } + public int getInputStreamCopyBufferSize() { return this.inputStreamCopyBufferSize; } diff --git a/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java b/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java index aa2403c73..8f6423c6f 100644 --- a/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java +++ b/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java @@ -139,6 +139,12 @@ public CommonSettings use(Session session) { return this; } + public void clearSession() { + resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_ID)); + resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_CHECK)); + resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_TIMEOUT)); + } + /** * Operation id. Used internally to register new operation. * Should not be called directly. diff --git a/client-v2/src/main/java/com/clickhouse/client/api/query/QuerySettings.java b/client-v2/src/main/java/com/clickhouse/client/api/query/QuerySettings.java index 95babb1ea..9df39f407 100644 --- a/client-v2/src/main/java/com/clickhouse/client/api/query/QuerySettings.java +++ b/client-v2/src/main/java/com/clickhouse/client/api/query/QuerySettings.java @@ -139,6 +139,11 @@ public QuerySettings use(Session session) { return this; } + public QuerySettings clearSession() { + settings.clearSession(); + return this; + } + /** * Read buffer is used for reading data from a server. Size is in bytes. * Minimal value is {@value MINIMAL_READ_BUFFER_SIZE} bytes. diff --git a/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java b/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java index 2801450ed..6a088a8bc 100644 --- a/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java +++ b/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java @@ -2,6 +2,7 @@ import com.clickhouse.client.api.ClientConfigProperties; import com.clickhouse.client.api.data_formats.ClickHouseBinaryFormatReader; +import com.clickhouse.client.api.http.ClickHouseHttpProto; import com.clickhouse.client.api.internal.ServerSettings; import com.clickhouse.client.api.query.QueryResponse; import com.clickhouse.client.api.query.QuerySettings; @@ -333,9 +334,12 @@ public void cancel() throws SQLException { return; } + // KILL QUERY must not run inside the same session as the query being cancelled otherwise it wil + // cause "Session is locked by a concurrent client" (SESSION_IS_LOCKED) error. + QuerySettings cancelSettings = QuerySettings.merge(getLocalSettings(), new QuerySettings()).clearSession(); try (QueryResponse response = connection.getClient().query(String.format("KILL QUERY%sWHERE query_id = '%s'", connection.onCluster ? " ON CLUSTER " + SQLUtils.enquoteIdentifier(connection.cluster, true) + ' ' : ' ', - lastQueryId), connection.getDefaultQuerySettings()).get()){ + lastQueryId), cancelSettings).get()){ LOG.debug("Query {} was killed by {}", lastQueryId, response.getQueryId()); } catch (Exception e) { throw new SQLException(e); diff --git a/jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java b/jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java index 4995caf16..79d0f11d6 100644 --- a/jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java +++ b/jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java @@ -9,7 +9,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; -import org.testng.SkipException; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -29,6 +28,8 @@ import java.util.Properties; import java.util.UUID; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; @@ -711,6 +712,126 @@ public void testConcurrentCancel() throws Exception { } } + /** + * Waits until the given query id appears in {@code system.processes}, so we know the operation has actually + * started on the server before attempting to cancel it. Uses a dedicated connection (no session) to observe. + */ + private boolean waitForQueryToStart(String queryId, int timeoutSeconds) throws Exception { + if (queryId == null) { + return false; + } + long deadline = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(timeoutSeconds); + while (System.currentTimeMillis() < deadline) { + try (Connection conn = getJdbcConnection(); + Statement stmt = conn.createStatement(); + ResultSet rs = stmt.executeQuery("SELECT count() FROM system.processes WHERE query_id = '" + queryId + "'")) { + + if (rs.next() && rs.getLong(1) > 0) { + return true; + } + } + Thread.sleep(200); + } + return false; + } + + private String waitForQueryId(StatementImpl stmt, int timeoutSeconds) throws Exception { + long deadline = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(timeoutSeconds); + while (System.currentTimeMillis() < deadline) { + String queryId = stmt.getLastQueryId(); + if (queryId != null && !queryId.isEmpty()) { + return queryId; + } + Thread.sleep(50); + } + return null; + } + + @Test(groups = {"integration"}) + public void testCancelQueryWithSession() throws Exception { + // Regression test for #2690: cancelling a query that runs inside a session must not fail with + // "Session is locked by a concurrent client" (SESSION_IS_LOCKED). The KILL QUERY request issued by + // cancel() must not carry the session id of the query being cancelled. + String sessionId = "test-session-" + UUID.randomUUID(); + try (Connection conn = getJdbcConnection()) { + try (StatementImpl stmt = (StatementImpl) conn.createStatement()) { + stmt.getLocalSettings().setSessionId(sessionId); + stmt.setQueryTimeout(30); // safety net so a failed cancel cannot hang the test + + final AtomicReference threadError = new AtomicReference<>(); + final CountDownLatch started = new CountDownLatch(1); + Thread worker = new Thread(() -> { + started.countDown(); + // Long-running query that only completes when killed. + try (ResultSet rs = stmt.executeQuery("SELECT count() FROM system.numbers_mt")) { + rs.next(); + } catch (Throwable t) { + System.out.println("Error: " + t.getMessage()); + threadError.set(t); + } + }); + worker.start(); + started.await(); + + String queryId = waitForQueryId(stmt, 15); + assertNotNull(queryId, "Query id was not assigned in time"); + assertTrue(waitForQueryToStart(queryId, 15), "Query did not start on the server in time"); + + // Cancel from the main thread - must not throw SESSION_IS_LOCKED. + stmt.cancel(); + + worker.join(TimeUnit.SECONDS.toMillis(20)); + assertFalse(worker.isAlive(), "Query was not cancelled and is still running"); + } + } + } + + @Test(groups = {"integration"}) + public void testCancelInsertWithSession() throws Exception { + // Regression test for #2690 covering a long-running INSERT executed inside a session. + String tableName = getDatabase() + ".cancel_insert_with_session"; + String sessionId = "test-session-" + UUID.randomUUID(); + try (Connection conn = getJdbcConnection(Map.of(ASYNC_INSERT_SETTING_KEY, ServerSettings.OFF))) { + try (Statement setup = conn.createStatement()) { + setup.execute("DROP TABLE IF EXISTS " + tableName); + setup.execute("CREATE TABLE " + tableName + " (num UInt64) ENGINE = MergeTree ORDER BY ()"); + } + + try (StatementImpl stmt = (StatementImpl) conn.createStatement()) { + stmt.getLocalSettings().setSessionId(sessionId); + stmt.setQueryTimeout(30); // safety net so a failed cancel cannot hang the test + + final AtomicReference threadError = new AtomicReference<>(); + final CountDownLatch started = new CountDownLatch(1); + Thread worker = new Thread(() -> { + started.countDown(); + // Long-running insert that only completes when killed. + try { + stmt.executeUpdate("INSERT INTO " + tableName + " SELECT number FROM system.numbers_mt"); + } catch (Throwable t) { + threadError.set(t); + } + }); + worker.start(); + started.await(); + + String queryId = waitForQueryId(stmt, 15); + assertNotNull(queryId, "Query id was not assigned in time"); + assertTrue(waitForQueryToStart(queryId, 15), "Insert did not start on the server in time"); + + // Cancel from the main thread - must not throw SESSION_IS_LOCKED. + stmt.cancel(); + + worker.join(TimeUnit.SECONDS.toMillis(20)); + assertFalse(worker.isAlive(), "Insert was not cancelled and is still running"); + } finally { + try (Statement cleanup = conn.createStatement()) { + cleanup.execute("DROP TABLE IF EXISTS " + tableName); + } + } + } + } + @Test(groups = {"integration"}) public void testTextFormatInResponse() throws Exception { try (Connection conn = getJdbcConnection(); From c1d52e5caf5ab6f969a519be30a459e28c85f848 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 8 Jun 2026 13:39:04 -0700 Subject: [PATCH 2/4] Updated changelog and fix minor things --- CHANGELOG.md | 4 +- .../client/api/insert/InsertSettings.java | 1 - .../client/api/internal/CommonSettings.java | 1 + .../com/clickhouse/client/SettingsTests.java | 48 +++++++++++++++++++ .../com/clickhouse/jdbc/StatementImpl.java | 2 +- 5 files changed, 53 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8e28090c..dd347a3a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.10.9 +## 0.10.0 ### Breaking Changes @@ -39,6 +39,8 @@ ### Bug Fixes +- **[jdbc-v2]** Fixed `Statement.cancel()` throwing `SESSION_IS_LOCKED` when the statement was running inside a ClickHouse session (e.g. via `clickhouse_setting_session_id`). The `KILL QUERY` request issued by `cancel()` now runs outside the session, so it no longer contends with the running query for the session lock. (https://github.com/ClickHouse/clickhouse-java/issues/2690) + - **[client-v2]** Fixed inconsistent use of `executionTimeout` parameter in `Client` component. The timeout was previously set in milliseconds but mistakenly retrieved and used in seconds in some places. Now it correctly uses milliseconds consistently. (https://github.com/ClickHouse/clickhouse-java/issues/2358) ## 0.9.8 diff --git a/client-v2/src/main/java/com/clickhouse/client/api/insert/InsertSettings.java b/client-v2/src/main/java/com/clickhouse/client/api/insert/InsertSettings.java index cf50c1ab6..7a2001eda 100644 --- a/client-v2/src/main/java/com/clickhouse/client/api/insert/InsertSettings.java +++ b/client-v2/src/main/java/com/clickhouse/client/api/insert/InsertSettings.java @@ -4,7 +4,6 @@ import com.clickhouse.client.api.ClientConfigProperties; import com.clickhouse.client.api.Session; import com.clickhouse.client.api.internal.CommonSettings; -import com.clickhouse.client.api.query.QuerySettings; import org.apache.hc.core5.http.HttpHeaders; import java.time.temporal.ChronoUnit; diff --git a/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java b/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java index 8f6423c6f..caa32d414 100644 --- a/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java +++ b/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java @@ -143,6 +143,7 @@ public void clearSession() { resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_ID)); resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_CHECK)); resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_TIMEOUT)); + resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_TIMEZONE)); } /** diff --git a/client-v2/src/test/java/com/clickhouse/client/SettingsTests.java b/client-v2/src/test/java/com/clickhouse/client/SettingsTests.java index ca4614a67..dca20f9ad 100644 --- a/client-v2/src/test/java/com/clickhouse/client/SettingsTests.java +++ b/client-v2/src/test/java/com/clickhouse/client/SettingsTests.java @@ -143,6 +143,30 @@ void testQuerySettingsSpecific() throws Exception { Assert.assertEquals(settings.getSessionTimeout().intValue(), 45); Assert.assertEquals(settings.getSessionTimezone(), "Europe/Berlin"); } + + { + final QuerySettings settings = new QuerySettings(); + settings.setSessionId("session-clear-1"); + settings.setSessionCheck(true); + settings.setSessionTimeout(60); + settings.setSessionTimezone("America/New_York"); + Assert.assertNotNull(settings.getSessionId()); + Assert.assertNotNull(settings.getSessionCheck()); + Assert.assertNotNull(settings.getSessionTimeout()); + Assert.assertNotNull(settings.getSessionTimezone()); + + settings.clearSession(); + + Assert.assertNull(settings.getSessionId(), "clearSession() must remove session_id"); + Assert.assertNull(settings.getSessionCheck(), "clearSession() must remove session_check"); + Assert.assertNull(settings.getSessionTimeout(), "clearSession() must remove session_timeout"); + Assert.assertNull(settings.getSessionTimezone(), "clearSession() must remove session_timezone"); + + // Non-session settings are unaffected. + settings.setDatabase("db1"); + settings.clearSession(); + Assert.assertEquals(settings.getDatabase(), "db1"); + } } @Test @@ -232,5 +256,29 @@ public void testInsertSettingsSpecific() throws Exception { Assert.assertEquals(settings.getSessionTimeout().intValue(), 50); Assert.assertEquals(settings.getSessionTimezone(), "Europe/Paris"); } + + { + final InsertSettings settings = new InsertSettings(); + settings.setSessionId("session-clear-2"); + settings.setSessionCheck(true); + settings.setSessionTimeout(90); + settings.setSessionTimezone("Asia/Tokyo"); + Assert.assertNotNull(settings.getSessionId()); + Assert.assertNotNull(settings.getSessionCheck()); + Assert.assertNotNull(settings.getSessionTimeout()); + Assert.assertNotNull(settings.getSessionTimezone()); + + settings.clearSession(); + + Assert.assertNull(settings.getSessionId(), "clearSession() must remove session_id"); + Assert.assertNull(settings.getSessionCheck(), "clearSession() must remove session_check"); + Assert.assertNull(settings.getSessionTimeout(), "clearSession() must remove session_timeout"); + Assert.assertNull(settings.getSessionTimezone(), "clearSession() must remove session_timezone"); + + // Non-session settings are unaffected. + settings.setDatabase("db2"); + settings.clearSession(); + Assert.assertEquals(settings.getDatabase(), "db2"); + } } } diff --git a/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java b/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java index 6a088a8bc..98b1e0a35 100644 --- a/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java +++ b/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java @@ -334,7 +334,7 @@ public void cancel() throws SQLException { return; } - // KILL QUERY must not run inside the same session as the query being cancelled otherwise it wil + // KILL QUERY must not run inside the same session as the query being canceled otherwise it will // cause "Session is locked by a concurrent client" (SESSION_IS_LOCKED) error. QuerySettings cancelSettings = QuerySettings.merge(getLocalSettings(), new QuerySettings()).clearSession(); try (QueryResponse response = connection.getClient().query(String.format("KILL QUERY%sWHERE query_id = '%s'", From 8ef9b31beef00109be1f8a1a2fe13647d906b732 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 8 Jun 2026 13:49:39 -0700 Subject: [PATCH 3/4] removed session_timezone from clearSession() --- .../clickhouse/client/api/internal/CommonSettings.java | 3 ++- .../test/java/com/clickhouse/client/SettingsTests.java | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java b/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java index caa32d414..e55d1429e 100644 --- a/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java +++ b/client-v2/src/main/java/com/clickhouse/client/api/internal/CommonSettings.java @@ -143,7 +143,8 @@ public void clearSession() { resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_ID)); resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_CHECK)); resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_TIMEOUT)); - resetOption(ClientConfigProperties.serverSetting(ClickHouseHttpProto.QPARAM_SESSION_TIMEZONE)); + // Do not clean `session_timezone` setting because it is not related to session management and used to + // set timezone for consequent queries in some multi-user applications. } /** diff --git a/client-v2/src/test/java/com/clickhouse/client/SettingsTests.java b/client-v2/src/test/java/com/clickhouse/client/SettingsTests.java index dca20f9ad..81261dc33 100644 --- a/client-v2/src/test/java/com/clickhouse/client/SettingsTests.java +++ b/client-v2/src/test/java/com/clickhouse/client/SettingsTests.java @@ -160,7 +160,9 @@ void testQuerySettingsSpecific() throws Exception { Assert.assertNull(settings.getSessionId(), "clearSession() must remove session_id"); Assert.assertNull(settings.getSessionCheck(), "clearSession() must remove session_check"); Assert.assertNull(settings.getSessionTimeout(), "clearSession() must remove session_timeout"); - Assert.assertNull(settings.getSessionTimezone(), "clearSession() must remove session_timezone"); + // session_timezone is not session-management state; it is preserved across clearSession(). + Assert.assertEquals(settings.getSessionTimezone(), "America/New_York", + "clearSession() must not remove session_timezone"); // Non-session settings are unaffected. settings.setDatabase("db1"); @@ -273,7 +275,9 @@ public void testInsertSettingsSpecific() throws Exception { Assert.assertNull(settings.getSessionId(), "clearSession() must remove session_id"); Assert.assertNull(settings.getSessionCheck(), "clearSession() must remove session_check"); Assert.assertNull(settings.getSessionTimeout(), "clearSession() must remove session_timeout"); - Assert.assertNull(settings.getSessionTimezone(), "clearSession() must remove session_timezone"); + // session_timezone is not session-management state; it is preserved across clearSession(). + Assert.assertEquals(settings.getSessionTimezone(), "Asia/Tokyo", + "clearSession() must not remove session_timezone"); // Non-session settings are unaffected. settings.setDatabase("db2"); From df1a53012ddf231f827a3d8971344b3e8494236e Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 8 Jun 2026 14:16:49 -0700 Subject: [PATCH 4/4] Fixed sonar issues --- .../clickhouse/client/api/command/CommandSettings.java | 1 + .../src/main/java/com/clickhouse/jdbc/StatementImpl.java | 1 - .../src/test/java/com/clickhouse/jdbc/StatementTest.java | 8 ++++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client-v2/src/main/java/com/clickhouse/client/api/command/CommandSettings.java b/client-v2/src/main/java/com/clickhouse/client/api/command/CommandSettings.java index e0780b4fa..b02d98eba 100644 --- a/client-v2/src/main/java/com/clickhouse/client/api/command/CommandSettings.java +++ b/client-v2/src/main/java/com/clickhouse/client/api/command/CommandSettings.java @@ -34,6 +34,7 @@ public CommandSettings use(Session session) { return this; } + @Override public CommandSettings clearSession() { super.clearSession(); return this; diff --git a/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java b/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java index 98b1e0a35..d5c4e4233 100644 --- a/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java +++ b/jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java @@ -2,7 +2,6 @@ import com.clickhouse.client.api.ClientConfigProperties; import com.clickhouse.client.api.data_formats.ClickHouseBinaryFormatReader; -import com.clickhouse.client.api.http.ClickHouseHttpProto; import com.clickhouse.client.api.internal.ServerSettings; import com.clickhouse.client.api.query.QueryResponse; import com.clickhouse.client.api.query.QuerySettings; diff --git a/jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java b/jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java index 79d0f11d6..eed401a14 100644 --- a/jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java +++ b/jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java @@ -9,6 +9,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; +import org.testng.SkipException; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -749,6 +750,10 @@ private String waitForQueryId(StatementImpl stmt, int timeoutSeconds) throws Exc @Test(groups = {"integration"}) public void testCancelQueryWithSession() throws Exception { + if (isCloud()) { + throw new SkipException("Cloud + HTTP doesn't work well. Enough to test locally"); + } + // Regression test for #2690: cancelling a query that runs inside a session must not fail with // "Session is locked by a concurrent client" (SESSION_IS_LOCKED). The KILL QUERY request issued by // cancel() must not carry the session id of the query being cancelled. @@ -788,6 +793,9 @@ public void testCancelQueryWithSession() throws Exception { @Test(groups = {"integration"}) public void testCancelInsertWithSession() throws Exception { + if (isCloud()) { + throw new SkipException("Cloud + HTTP doesn't work well. Enough to test locally"); + } // Regression test for #2690 covering a long-running INSERT executed inside a session. String tableName = getDatabase() + ".cancel_insert_with_session"; String sessionId = "test-session-" + UUID.randomUUID();