[client-v2] Request cancellation#2903
Conversation
…us code to be more certain about codes
|
Repository collaborators can run the JMH benchmark suite against this PR by commenting: Optional regression threshold override (Δ% on Time or Alloc/op; defaults to 10%): Only one benchmark run per PR is active at a time — issuing a new |
TriageCategory: Summary What this impacts
Concerns
Required reviewer action
|
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 862dd48. Configure here.
|




Summary
This PR implement client API to cancel request by original
queryId.What request cancellation means from client side is ability to interrupt outgoing network request when it is not needed any more. In most cases it is implemented with timeouts on client and server side. However there are cases when request should be cancelled before timeout (new data arrived, for instance).
JDBC in this case has request cancellation by sending
KILL QUERY. This guarantees to interrupt request. JDBC requirescancelmethod by spec because only driver implementation knows how to handle it.Client in this case doesn't require a
cancelmethod because query can be constructed in preferable by user way. Client, however, can provide method to try canceling network request by interrupting IO operation.This PR does implement request cancellation on client level. Implementation is based on the fact that each request correlates to a
queryId. User can specify it. Internally client stores map betweenqueryIdand request object that should be cancelled.Closes #1760
Closes #2802
Checklist
Delete items not relevant to your PR: