Repository navigation
fix(telemetry): count status polls issued by synchronous execute - #524
Conversation
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>
There was a problem hiding this comment.
🔀 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.
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
🔀 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.
|
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 |
Description
Statement::execute()pollsGetStatementStatusinside the SEA transport when a statement outlasts the inline wait, but those polls never reached the statement's telemetry. OnlyExecutedAsyncStatementcalledrecord_poll. So the syncEXECUTE_STATEMENTevent reportedn_operation_status_calls=0andoperation_status_latency_millis=0even 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 200GetStatementStatusfor 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, andwait_for_terminalrecords each successful poll, the same way the async handle does. That covers ADBC's defaultexecute()and bound-parameter execution, which both go throughStatement::execute*.Testing
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 warningsandcargo testpass.sea_execute_statement_force_asyncscenario 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 ADBCtelemetrysuite 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 reachexecute_and_readthrough theTransportmetadata methods withExecutionParams::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 nineTransportmetadata methods and the test transports, which is better as a follow-up.This pull request and its description were written by Isaac.