Skip to content

Fix missing timeout cancellation telemetry - #1676

Open
vuanhphung wants to merge 2 commits into
mainfrom
vu-phung_data/fix-timeout-cancel-telemetry
Open

Fix missing timeout cancellation telemetry#1676
vuanhphung wants to merge 2 commits into
mainfrom
vu-phung_data/fix-timeout-cancel-telemetry

Conversation

@vuanhphung

@vuanhphung vuanhphung commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes missing statement telemetry for driver-side polling timeouts observed in ES-2188393.

Affected CUJ:

  1. An operation has a statement ID and driver-side timeout, and remains PENDING or RUNNING.
  2. The driver repeatedly polls its status.
  3. Thrift buffers poll count and cumulative latency; SEA previously did not record these polls.
  4. The local timeout expires and cancellation succeeds: Thrift calls raw CancelOperation, while SEA makes an internal cancelStatement self-call.
  5. These calls bypass the timed client proxy.
  6. After cancellation returns, timeout handling throws DatabricksTimeoutException; the proxy records latency only after normal returns.
  7. Thrift's buffered tracker was therefore not exported at cancellation, while SEA had neither buffered polling details nor a terminal statement event.

This change records SEA status polling details and, after successful timeout cancellation, records CANCEL_STATEMENT with the explicit connection context and statement ID. Both paths now export the terminal event with accumulated poll count and latency. Ordinary synchronous SEA polling also populates the existing poll-count and cumulative-latency fields on later terminal events.

Testing

  • mvn test -pl jdbc-core -Dtest=TelemetryCollectorTest,TelemetryHelperTest,TimeoutHandlerTest,DatabricksSdkClientTest,DatabricksThriftAccessorTest
  • 225 tests, 0 failures/errors
  • Collector test uses the real operation mapper and verifies poll count, summed poll latency, CANCEL_STATEMENT, cancellation latency, and tracker removal
  • mvn spotless:apply

Telemetry Errors

  • Not applicable — this PR does not add or change a telemetry-visible error.
  • Applicable — the error uses DatabricksDriverErrorCode where appropriate, and any new code is uniquely numbered and tested.
  • Applicable — its driver/server/user classification is linked, or maintainer help is requested because the author cannot access the classification.

Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review bot failed — see workflow logs.

Reason: model did not call finalize_review and the final text was not parseable JSON: Empty response

Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No issues identified by the review bot.

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.

1 participant