Skip to content

[jdbc-v2] Investigate test failure on CH head version #3264

Closed

Description

@chernser

Description

There are tests failing on the head version:

[ERROR]   StatementTest.testCancelOnCluster:747 » SQL com.clickhouse.client.api.ServerException: Code: 785. DB::Exception: No query to kill. (NOTHING_TO_KILL) (version 26.11.1.880 (official build))  (queryId= 5a7ada78-1727-428d-a1cc-d747a1a364c9)
[ERROR]   StatementTest.testConcurrentCancel:760 » SQL com.clickhouse.client.api.ServerException: Code: 785. DB::Exception: No query to kill. (NOTHING_TO_KILL) (version 26.11.1.880 (official build))  (queryId= 403c0e75-837b-476c-a2fb-5fa19c8ed8bb)

Is this timing issue or something changed in logic? What is the proper way to kill the query?
We need to make sure that this error do not cause breaking application code with no reason (should it be a warning) ?

Activity

  1. added this to the 0.12.0 milestone on Oct 29, 2026
  2. chernser commented on Oct 29, 2026

    @chernser
    ContributorAuthor

    @polyglotAI-bot please investigate the issue and fix it.

  3. polyglotAI-bot commented on Oct 29, 2026

    @polyglotAI-bot
    Collaborator

    This is a server logic change, not a timing problem. ClickHouse 26.11 enables kill_throw_if_noop by default (ClickHouse/ClickHouse#125968, "Backward Incompatible Change"). With this setting, a local KILL QUERY that matches no running query fails with NOTHING_TO_KILL (785). ON CLUSTER stays tolerant. The setting exists since 26.10, where the default is 0.

    In both tests cancel() runs when the statement has no running query. In testCancelOnCluster the SELECT 1 is already finished. In testConcurrentCancel the query is not started yet, and lastQueryId can still be null. Verified on 26.11.1.888 (head) and on 26.10.3.7 with kill_throw_if_noop=1.

    KILL QUERY WHERE query_id = ... is still the correct way to kill the query. When there is no running query, there is nothing to cancel, so this must not be an error for the application. Fix: #3271. Statement.cancel() now ignores NOTHING_TO_KILL and writes a debug log, in sync and async mode. Other KILL QUERY errors are thrown as before. The fix does not send kill_throw_if_noop=0, because servers before 26.10 reject the unknown setting.

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

Metadata

Metadata

Labels

area:generalgeneral issue without a specific area.jdbc-v2jdbc-v2 issues

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions