Skip to content

[coverage] Conformance findings: RESULTFETCH-214701,RESULTFETCH-214702 #1065

Closed

Description

@peco-engineer-bot

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 under tests/)
  • 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 under tests/)
  • 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 under tests/)
  • 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 under tests/)
  • 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: 1

RESULTFETCH-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 1

Expected (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: 1

Context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions