Skip to content

fix(telemetry): count status polls issued by synchronous execute - #524

Merged
vuanhphung merged 3 commits into
mainfrom
fix/sync-poll-status-telemetry
Dec 2, 2026
Merged

vuanhphung merged 3 commits into
mainfrom
fix/sync-poll-status-telemetry

Conversation

@vuanhphung

@vuanhphung vuanhphung commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Statement::execute() polls GetStatementStatus inside the SEA transport when a statement outlasts the inline wait, but those polls never reached the statement's telemetry. Only ExecutedAsyncStatement called record_poll. So the sync EXECUTE_STATEMENT event reported n_operation_status_calls=0 and operation_status_latency_millis=0 even after the driver polled.

The driver-test Kernel nightly caught this on 2026-12-02 (run 46796916982, synchronous_query_full_consumption_telemetry). The proxy saw one 200 GetStatementStatus for the statement, and the event reported 0 status calls. The bug only shows when the server needs a poll, which is why the nightly was green on earlier nights.

This change passes the statement telemetry to the transport on ExecutionParams, and wait_for_terminal records each successful poll, the same way the async handle does. That covers ADBC's default execute() and bound-parameter execution, which both go through Statement::execute*.

Testing

  • New unit test sync_statement_execute_records_internal_status_polls: the POST returns RUNNING, the first poll RUNNING, the second SUCCEEDED. The test expects exactly 2 status calls. Without the fix it fails with 0.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test pass.
  • Live run against a warehouse through the driver-test proxy. The sea_execute_statement_force_async scenario makes the sync path poll. On main, 3 of 3 runs had 1 wire poll and 0 status calls reported. With this change, 3 of 3 reported 1 status call with 456–506 ms latency. The driver-test Rust ADBC telemetry suite passes against this branch (14 passed, 1 existing ignore). A full driver-test Rust ADBC run against this branch: https://github.com/databricks/databricks-driver-test/actions/runs/46814002777.

Additional notes

Failed status requests are not counted, the same as the async path.

Metadata operations (list_catalogs, list_tables, and so on) are out of scope here. They reach execute_and_read through the Transport metadata methods with ExecutionParams::default(), so their polls are still not counted. They send the sync-metadata header, so the server normally answers in the first response. Counting their polls means passing telemetry through all nine Transport metadata methods and the test transports, which is better as a follow-up.

This pull request and its description were written by Isaac.

Statement::execute() polls GetStatementStatus inside the SEA transport when a
statement outlasts the inline wait, but those polls never reached the
statement's telemetry; only ExecutedAsyncStatement called record_poll. The
sync EXECUTE_STATEMENT event reported n_operation_status_calls=0 and
operation_status_latency_millis=0 even after polling.

Pass the statement telemetry to the transport on ExecutionParams and record
each successful poll in wait_for_terminal, matching the async path.

Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>

@oss-reviewer-bot oss-reviewer-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.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 Low

Looks good, with one low concern. Each successful status poll inside the sync execute path is now recorded, the same way the async handle does it, and the new test fails without the fix. The latency assertion in that test is weaker than it should be.

Comment thread src/session.rs Resolved
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>

@oss-reviewer-bot oss-reviewer-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.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 Low

Looks good, with 1 low concern. Each successful poll is recorded once, ExecutionParams::default() keeps the field None everywhere else, and the async path doesn't double-count. Metadata operations still skip poll counting.

Comment thread src/client/transport.rs Resolved
@vuanhphung

Copy link
Copy Markdown
Collaborator Author

The macOS dSYM cancellation isn't caused by this PR. That job gets cancelled at the 55-minute mark on main too (run 46766902572 at 5869200, this PR's base) and on every recent PR run of Release Debuginfo. Everything else is green. A driver-test Rust ADBC live run against this branch also passed: https://github.com/databricks/databricks-driver-test/actions/runs/46814002777

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.

3 participants