You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a query's result is delivered inline via direct results (SEA ExecuteStatement returns status.state == CLOSED — the statement is already closed server-side), the kernel still issues a redundant CloseStatement (HTTP DELETE /api/2.0/sql/statements/{id}) on ExecutedStatement::close().
Per the spec (adbc-drivers/databricks#566 — matched by C# ADBC and databricks-jdbc), no CloseStatement should be sent when the statement is already closed. Surfaced by the conformance suite (databricks-driver-test, spec CLOUDFETCH-013), committed there as a #[should_panic] xfail tripwire.
Test inline_direct_results_no_redundant_close_statement in tests/kernel/tests/cloud_fetch.rs asserts CloseStatement == 0 on the inline path; currently fails.
#168 reports the same redundant CloseStatement on the metadata path and states the regular-query path correctly recognizes CLOSED and skips the close. This issue shows the redundant close also fires on the inline direct-results regular-query path — so the fix should suppress the close whenever the ExecuteStatement response already reported state=CLOSED, regardless of path. Filing separately so the inline-path conformance cell (CLOUDFETCH-013) has a precise tracker; close as duplicate of #168 if you prefer to track both under one.
Finding on the inline sync-query path (this issue's premise): the redundant CloseStatement on the inline direct-results regular-query path is not reproducible against current main — that path already skips the close. Statement::execute computes already_closed = result.status.state == StatementState::Closed (landed in #140) and pre-seeds the shared closed flag, so the drain auto-close, explicit close(), and Drop all short-circuit. #222 adds a wire-level regression test locking this in — execute_closed_inline_skips_close_statement (a plain SELECT 1 inline with state=CLOSED, drained + explicitly closed → asserts 0 DELETEs). It's a verified tripwire: forcing already_closed = false makes it fail with one observed DELETE.
What #222 actually fixed: the same bug pattern did exist on the async path (Statement::submit → ExecutedAsyncStatement). Reaching CLOSED via an await_result() / fetch_result() poll never flipped the closed flag, so close()/Drop fired a redundant DELETE. Fixed in materialise_result (the common sink for both), mirroring the sync path.
Note on CLOUDFETCH-013: the xfail tripwire referenced here (tests/kernel/tests/cloud_fetch.rs) lives in the databricks-driver-test repo, so #222 can't touch it. Its CloseStatement == 0 assertion on the inline sync path now holds against the kernel — that cell can be un-xfailed there once the kernel pin is bumped past #222. If the driver-test proxy replay was still observing a stray DELETE, the likely source was the async path (now fixed) or the deliberate fire-and-forget close ordering (a detached runtime.spawn, not a redundant close — see the rationale in #222; it's not a correctness issue and was intentionally kept off the critical path per #85).
Closing as resolved by #222. Reopen if the driver-test conformance cell still shows a redundant close on the kernel-sync inline path after the pin bump.
Activity
vikrantpuppala commentedon Aug 10, 2026
Resolved by #222 (merged), alongside #168.
Finding on the inline sync-query path (this issue's premise): the redundant
CloseStatementon the inline direct-results regular-query path is not reproducible against currentmain— that path already skips the close.Statement::executecomputesalready_closed = result.status.state == StatementState::Closed(landed in #140) and pre-seeds the sharedclosedflag, so the drain auto-close, explicitclose(), andDropall short-circuit. #222 adds a wire-level regression test locking this in —execute_closed_inline_skips_close_statement(a plainSELECT 1inline withstate=CLOSED, drained + explicitly closed → asserts 0 DELETEs). It's a verified tripwire: forcingalready_closed = falsemakes it fail with one observed DELETE.What #222 actually fixed: the same bug pattern did exist on the async path (
Statement::submit→ExecutedAsyncStatement). ReachingCLOSEDvia anawait_result()/fetch_result()poll never flipped theclosedflag, soclose()/Dropfired a redundant DELETE. Fixed inmaterialise_result(the common sink for both), mirroring the sync path.Note on CLOUDFETCH-013: the xfail tripwire referenced here (
tests/kernel/tests/cloud_fetch.rs) lives in the databricks-driver-test repo, so #222 can't touch it. ItsCloseStatement == 0assertion on the inline sync path now holds against the kernel — that cell can be un-xfailed there once the kernel pin is bumped past #222. If the driver-test proxy replay was still observing a stray DELETE, the likely source was the async path (now fixed) or the deliberate fire-and-forget close ordering (a detachedruntime.spawn, not a redundant close — see the rationale in #222; it's not a correctness issue and was intentionally kept off the critical path per #85).Closing as resolved by #222. Reopen if the driver-test conformance cell still shows a redundant close on the kernel-sync inline path after the pin bump.