Repository navigation
Closed
Description
Summary
Surfaced by the multi-language coverage fan-out while conformance-testing these SPEC-IDs against databricks/databricks-sql-python. Each finding is committed as an expected-failure (xfail) test in the coverage PR — the test asserts the CORRECT (post-fix) behavior and stays red until THIS driver (databricks/databricks-sql-python) is fixed, then flips green as a tripwire.
Findings
- RESULTFETCH-214701 [thrift]: A close racing an in-flight fetch surfaces HTTP 404 RESOURCE_DOES_NOT_EXIST from the invalidated FetchResults instead of reporting the operation CLOSED, and when the close RPC fails the fetch returns a silently truncated success instead of failing
- failing test:
test_close_during_in_flight_result_fetch(see the coverage PR diff undertests/)
- failing test:
- RESULTFETCH-214701 [sea]: On the kernel (SEA) backend a close racing an in-flight fetch kills the fetch with an internal connector AttributeError ('NoneType' has no attribute 'fetch_next_batch') rather than a CLOSED report, and the kernel-side close is swallowed as 'Already borrowed' so no CloseStatement is sent and the statement is left open server-side
- failing test:
test_close_during_in_flight_result_fetch(see the coverage PR diff undertests/)
- failing test:
- RESULTFETCH-214702 [thrift]: A cancel racing an in-flight fetch surfaces HTTP 404 RESOURCE_DOES_NOT_EXIST from the torn-down FetchResults instead of identifying the operation as CANCELLED, so a caller cannot distinguish its own cancellation from a query failure
- failing test:
test_cancel_during_in_flight_result_fetch(see the coverage PR diff undertests/)
- failing test:
- RESULTFETCH-214702 [sea]: On the kernel (SEA) backend Cursor.cancel() during an in-flight fetch dispatches no CancelStatement and does not interrupt the fetch (the full remaining result is delivered), because cancel_command() short-circuits for sync-execute commands on the assumption the result is already fully materialised — untrue for the lazily streaming KernelResultSet
- failing test:
test_cancel_during_in_flight_result_fetch(see the coverage PR diff undertests/)
- failing test:
- RESULTFETCH-214701: A close racing an in-flight fetch does not report the operation as CLOSED: thrift surfaces the invalidated stream's HTTP 404 RESOURCE_DOES_NOT_EXIST transport error (and, when the close RPC itself fails, the fetch returns a silently TRUNCATED success instead of failing), while on the kernel backend KernelResultSet.close() nulls the handle under the running drain so the fetch dies with an internal AttributeError and the kernel close is swallowed as "Already borrowed", leaving the statement open server-side
- RESULTFETCH-214702: A cancel racing an in-flight fetch does not report the operation as CANCELLED: thrift surfaces the torn-down stream's HTTP 404 RESOURCE_DOES_NOT_EXIST transport error, and on the kernel backend Cursor.cancel() is dropped entirely (zero CancelStatement RPCs, the fetch drains the whole remaining result) because KernelDatabricksClient.cancel_command() short-circuits for sync-execute commands on the assumption that the result is fully materialised, which is false for the streaming KernelResultSet
Reproduce & Expected
RESULTFETCH-214701 — Verify that a result fetch which is ALREADY IN FLIGHT when the application closes the operation fails promptly with the operation's CLOSED state -- not with the internal failure of the result stream…
Reproduce:
SELECT id, uuid() AS u FROM range(0, 3000000)
SELECT 1
SELECT id, uuid() AS u FROM range(0, 3000000)Expected (per the shared spec):
- completes without an exception
- result has exactly 1 row(s)
- full assertion contract:
result:
- label: close_succeeds
exception_thrown: true
- label: close_succeeds
operation_state_error: closed
- label: close_succeeds
elapsed_seconds_range:
max: 10
- label: connection_usable
no_exception: true
- label: connection_usable
row_count: 1
- label: close_rpc_fails
exception_thrown: true
- label: close_rpc_fails
operation_state_error: closed
- label: close_rpc_fails
rows_delivered_after_close: 0
protocol:
thrift:
- label: close_succeeds
call_min:
method: CloseOperation
min: 1
- label: close_rpc_fails
call_min:
method: CloseOperation
min: 1
sea:
- label: close_succeeds
call_min:
operation: CloseStatement
min: 1
- label: close_rpc_fails
call_min:
operation: CloseStatement
min: 1RESULTFETCH-214702 — Verify that a result fetch which is ALREADY IN FLIGHT when the application cancels the operation fails promptly with the operation's CANCELLED state -- not with the internal failure of the result str…
Reproduce:
SELECT id, uuid() AS u FROM range(0, 3000000)
SELECT 1Expected (per the shared spec):
- completes without an exception
- result has exactly 1 row(s)
- full assertion contract:
result:
- exception_thrown: true
- operation_state_error: canceled
- elapsed_seconds_range:
max: 10
- label: connection_usable
no_exception: true
- label: connection_usable
row_count: 1
protocol:
thrift:
- call_min:
method: CancelOperation
min: 1
- call_min:
method: CloseOperation
min: 1
sea:
- call_min:
operation: CancelStatement
min: 1
- call_min:
operation: CloseStatement
min: 1Context
- The behavior was first fixed in a DIFFERENT driver — reference PR: fix: update kernel pin and keep the close-race error typed databricks-sql-nodejs#619 — which seeded the shared language-neutral spec. This issue tracks the same conformance gap in databricks/databricks-sql-python; the reference PR is for cross-referencing the intended behavior, NOT a change to this repo.
- Coverage PR carrying the reproducing xfail test(s): https://github.com/databricks/databricks-driver-test/pull/2148
Metadata
Metadata
Assignees
Labels
No labels
Activity