Skip to content

feat(volume): expose Volume options through the C ABI, ADBC, NAPI and PyO3 - #521

Merged
aakash-saravanan-db merged 9 commits into
mainfrom
aakash-saravanan_data/feat/volume-bindings-rebuild-20261201
Dec 3, 2026
Merged

aakash-saravanan-db merged 9 commits into
mainfrom
aakash-saravanan_data/feat/volume-bindings-rebuild-20261201

Conversation

@aakash-saravanan-db

@aakash-saravanan-db aakash-saravanan-db commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Exposes the Volume file transfers from #520 in each binding. A binding sets the kernel's StatementSpec::volume, so executing a Volume PUT, GET or REMOVE moves the file, and the binding's existing cancel and close paths stop it.

Binding Sets the Volume options Also adds
C ABI (Go, ODBC) kernel_statement_set_volume_options(stmt, allowed_paths_json, remove_not_found_is_success) kernel_executed_statement_is_volume_operation, kernel_executed_async_statement_is_volume_operation, kernel_result_stream_is_volume_operation, and kernel_get_last_error_code / _local_os_error / _local_path
PyO3 Statement.set_volume_options(allowed_paths, remove_not_found_is_success=False, input_bytes=None) is_volume_operation; local_os_error and local_path on KernelError
NAPI ExecuteOptions.volume: { allowedPaths, removeNotFoundIsSuccess? } isVolumeOperation; localOsError, localErrorKind and localPath on errors
ADBC statement option adbc.databricks.statement.staging_allowed_local_paths execute_update on a Volume statement without the option fails with InvalidState
  • C ABI: on an async statement, reading the result stream runs the transfer. kernel_executed_async_statement_is_volume_operation reports the marker from the successful status poll, so a host that polls, such as ODBC in async mode, can run only that read off its polling thread.
  • Only PyO3 takes upload bytes, so in the C ABI, NAPI and ADBC a PUT '__input_stream__' fails.
  • NAPI: socketTimeoutMs: 0 now keeps the kernel default instead of setting a zero request timeout. AsyncStatement.close() now cancels a call that still holds the statement, such as an awaitResult() running a transfer, instead of waiting for it.

Builds on #520, now in main. Supersedes #513.

Testing

Run locally on main with #511: fmt, clippy with -D warnings and the tests pass: root 1,424, NAPI 96, ADBC 103, and PyO3 32 Rust and 34 Python tests (live tests skipped). make c-abi-test passes, and every commit builds all four crates. primary_keys_rejects_invalid_current_namespace_and_closes_lookup fails about 1 run in 10 on main as well, and this PR does not touch it.

New tests check that each binding's options reach the transfer and that local error details reach the caller. They also cover:

  • the C ABI null-handle guards, and a live C ABI statement whose transfer runs and whose local error details reach the caller;
  • the async Volume marker before the status poll, after it, and once the result is read;
  • the ADBC InvalidState and cancel paths, and the option's read-back, JSON null clear and invalid-JSON error;
  • NAPI socketTimeoutMs: 0;
  • NAPI close() cancelling an awaitResult() that is still running a transfer.

Additional notes

napi/index.d.ts adds only the new declarations, taken from @napi-rs/cli@3.8.2 output. Regenerating the whole file with that CLI changes its layout.

This pull request and its description were written by Isaac.

@aakash-saravanan-db
aakash-saravanan-db marked this pull request as ready for review December 1, 2026 02:04
@aakash-saravanan-db
aakash-saravanan-db requested a review from a team as a code owner December 1, 2026 02:04

@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: 4 Low · 1 Nit

Mostly solid, with 1 medium and 3 low concerns. The bindings follow the core Volume API consistently, and cancel and close paths are wired and tested in NAPI and the C ABI.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Other findings

  • ⚪ Nit — The new tests were inserted between existing doc comments and the items they describe (also base() in napi/src/database.rs), so the comments now describe the wrong function. Move each new test above the orphaned doc comment. (Found by Claude Opus 5.5 · confirmed by the judge)

Comment thread adbc/src/statement.rs Resolved
Comment thread pyo3/src/errors.rs Resolved
Comment thread napi/src/async_statement.rs Resolved
Comment thread src/c_abi/statement.rs Resolved

@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 Medium · 2 Low · 1 Nit

Mostly solid: 1 medium and 3 low issues. The FFI enum layout matches the C header (repr(C), 0/1/2), and the ADBC SocketTimeout path rejects zero. The main gap is Python KernelError attributes that are missing on errors that aren't local file errors.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge and GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Other findings

  • ⚪ Nit — The new tests were inserted between existing doc comments and the items they document (base() in napi/src/database.rs, and the request-timeout test in src/c_abi/session.rs), so the comments now attach to the wrong item. Move each new test above the doc comment. (Found by Claude Opus 5.5 · confirmed by the judge)
  • 🔵 Low — The cancellation test fires the canceller before completion starts, so it only exercises the already-cancelled branch rather than interruption of a running C-ABI transfer. Add a delayed storage response, wait until the request arrives, then cancel from another thread and assert bounded completion with Cancelled and unchanged destination contents. (Found by GPT-6.1 Sol · the judge couldn't confirm it)
🔀 1 finding considered and dismissed by the judge
  • 🔵 Low src/c_abi/result.rs:670 — out is left unwritten on the invalid-JSON, invalidated-handle and transfer-failure paths, so a C caller that reads it after an error sees uninitialized memory
    Judge's evidence: std::ptr::write(out, outcome);

Comment thread pyo3/src/errors.rs Resolved
Comment thread pyo3/src/errors.rs Resolved

@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 Nit

Looks good, with 1 low concern. Volume completion, cancellation and the timeout mappings are consistent across the C ABI, ADBC, NAPI and PyO3, and the zero-means-no-limit setting matches the kernel's idle_limit filter. The C ABI, NAPI and ADBC each have a cancel-during-transfer test.

Other findings

  • ⚪ Nit — The docstring says cancelling or closing the parent ExecutedAsyncStatement stops a running transfer, but pyo3/tests/test_volume.py has no cancel-during-transfer test. The C ABI, NAPI and ADBC bindings each have one. Add a slow-storage test that cancels from another thread and asserts a Cancelled KernelError. (Found by Claude Opus 5.5 · confirmed by the judge)

@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 2 low concerns. The bindings carry the Volume options and the error details through consistently, and zero (C ABI) and None (NAPI) both mean no idle limit, because src/volume.rs:166 treats a zero limit as no limit.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge and GPT-6.1 Sol added findings it doesn't mention — see the findings below.

🔀 1 finding considered and dismissed by the judge
  • 🔵 Low pyo3/src/statement.rs:91 — set_volume_options(None, input_bytes=b"...") drops input_bytes without any error, so a caller who supplies upload bytes but forgets the paths gets no hint.
    Judge's evidence: /// ''allowed_paths=None'' clears them, so a Volume statement returns its

Comment thread napi/src/async_statement.rs Resolved

@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: 2 Low · 1 Nit

Looks good: 2 low concerns. The bindings wire StatementSpec::volume consistently, and Duration::ZERO meaning no limit matches volume.rs:166.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Other findings

  • ⚪ Nit — On the bound-row path, a rejected row drops executed without the explicit close() the unbound paths run. ExecutedStatement::drop spawns a fire-and-forget close, so nothing leaks, but the two paths are inconsistent. Close executed before returning the error. (Found by Claude Opus 5.5 · confirmed by the judge)

Comment thread pyo3/src/statement.rs Resolved
Comment thread napi/src/async_statement.rs Resolved

@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: 3 Low

Mostly solid. I found one medium concern about the changed NAPI close() semantics and one low one about cleanup in the ADBC bound-row error path. The C ABI, PyO3 and ADBC wiring line up with the kernel's zero/None idle-limit semantics.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge and GPT-6.1 Sol added findings it doesn't mention — see the findings below.

🔀 1 finding considered and dismissed by the judge
  • 🔵 Low src/c_abi/result.rs:639 — Both new is_volume_operation accessors leave a writable *out unchanged on invalid or invalidated handles, unlike the existing sentinel-initializing C ABI acce
    Judge's evidence: return store_invalid_arg("kernel_result_stream_is_volume_operation: null pointer");

Comment thread napi/src/async_statement.rs Resolved
Comment thread adbc/src/statement.rs Resolved
Comment thread napi/src/async_statement.rs Resolved

@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 Medium

Looks good, with 1 medium concern. The bindings forward the Volume options and local error details consistently, and the C ABI, PyO3 and ADBC changes come with tests. The NAPI change where close() cancels a running call has no test. Nit: an extra blank line was added in include/databricks_kernel.h after kernel_session_config_set_request_timeout.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge — see the findings below.

🔀 1 finding considered and dismissed by the judge
  • 🔵 Low src/c_abi/result.rs:635 — Both new Volume flag getters leave a writable out parameter unchanged on failure, so an invalidated handle can leave a previously true flag visible instead of a
    Judge's evidence: return store_invalid_arg("kernel_result_stream_is_volume_operation: null pointer");

Comment thread napi/src/async_statement.rs Resolved

@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 · 1 Nit

Looks good, with 2 low concerns. Each binding passes the Volume options into StatementSpec::volume and cancels or closes the transfer correctly. New tests cover the options reaching the transfer and the local error details in every binding.

Other findings

  • ⚪ Nit — The test only sets the option to []. The new get_option branch and clearing with JSON null (which the README documents) have no test. Add a round-trip test: set an array, read the same JSON back, set null, then expect NotFound. (Found by Claude Opus 5.5 · confirmed by the judge)

Comment thread napi/src/async_statement.rs Resolved

@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 Medium

Looks good, with one low concern. The Volume options reach the transfer in all four bindings, and new tests cover each one along with the cancel paths. The async volume flag does not check owner_released the way the other accessors on that type do.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge and GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Other findings

  • 🟡 Medium — If cancellation fails while awaitResult() is polling a running query, close() discards that failure and waits for the same mutex until the query finishes or times out, hiding the reason it cannot interrupt the call. Propagate the cancellation error before waiting (or provide an independent local interruption path), and test a failed cancel RPC against a continuously running statement. (Found by GPT-6.1 Sol · the judge couldn't confirm it)
🔀 1 finding considered and dismissed by the judge
  • 🔵 Low src/statement/executed_async.rs:585 — is_volume_operation reads pending_result without checking owner_released. Its siblings do check it (the accessor near line 571 and take_pending_result a
    Judge's evidence: self.owner_released.store(true, Ordering::Release); self.clear_pending_result();

@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).

✅ No issues identified.

🔀 3 findings considered and dismissed by the judge
  • 🔵 Low src/c_abi/statement.rs:885 — An invalidated executed handle returns an error without initializing *out, leaving a previously true Volume marker intact, unlike the status accessor's sentin
    Judge's evidence: if !handle.exec.is_valid() {
  • 🔵 Low src/statement/executed_async.rs:584 — is_volume_operation reads pending_result without checking owner_released. If the parent re-executes or closes through the shared flag, the handle still re
    Judge's evidence: self.owner_released.store(true, Ordering::Release); self.clear_pending_result();
  • 🔵 Low napi/src/async_statement.rs:401 — let _ = in_flight.cancel().await drops the cancel error, and close() then waits on inner.lock(). If the cancel RPC fails, close() waits for the whole tr
    Judge's evidence: let _ = in_flight.cancel().await;

@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 2 low concerns. The Volume options wiring across the C ABI, ADBC, NAPI and PyO3 is consistent and well tested. The two remaining issues are a missing owner-invalidation check and one cleanup path that skips the explicit close.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge — see the findings below.

🔀 2 findings considered and dismissed by the judge
  • 🔵 Low adbc/src/statement.rs:920 — In the bound-row loop, when require_staging_option fails inside and_then, the ExecutedStatement is dropped without the explicit close() that the unbound
    Judge's evidence: // The kernel closes dropped executed handles asynchronously. Waiting
  • 🟡 Medium src/c_abi/statement.rs:469 — C ABI tests only call this setter with a null handle and inject local errors directly, leaving option forwarding and worker-to-caller error propagation untested
    Judge's evidence: stmt.spec().volume(options);

Comment thread src/statement/executed_async.rs Resolved

@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: 3 Low · 1 Nit

Looks good, with 4 low concerns. The bindings forward the Volume options consistently and have focused tests. What remains is cleanup consistency on the ADBC bound-row error path, a cancel error that NAPI close() discards, catch_ffi coverage on the new C getters, and missing tests for the ADBC option's read-back, null-clear and invalid-JSON handling.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge and GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Other findings

  • ⚪ Nit — The ADBC test does not cover the get_option round-trip, clearing with JSON null, or the InvalidArguments status for malformed JSON, although the README documents all three. Add assertions for them. (Found by Claude Opus 5.5 · confirmed by the judge)
🔀 1 finding considered and dismissed by the judge
  • 🔵 Low src/c_abi/error.rs:175 — The three new kernel_get_last_error_* extern "C" getters skip catch_ffi. A panic in LAST_ERROR.with (for example, a TLS access during thread teardown) wou
    Judge's evidence: LAST_ERROR.with(|cell| cell.borrow().local_os_error)

Comment thread napi/src/async_statement.rs Resolved
Comment thread src/c_abi/statement.rs Resolved
Comment thread adbc/src/statement.rs Resolved

@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 · 1 Nit

Looks good, with 1 low concern. The C ABI, ADBC, NAPI and PyO3 changes all set StatementSpec::volume, and each binding has tests at the right tier. The FFI accessors are wrapped in catch_ffi and guard against null arguments.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Other findings

  • ⚪ Nit — close() falls into the cancel branch whenever try_lock fails, including when only a brief status() call or another close() holds inner, so it sends a needless server cancel and ignores any cancel error. The effect is minor because close ends the statement anyway. Fix: skip the cancel when closed is already set, and log the cancel error. (Found by Claude Opus 5.5 · confirmed by the judge)

Comment thread src/statement/executed_async.rs Resolved

@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 Nit

Looks good, no blocking issues. I checked the C ABI null guards and last-error lifetime, the async Volume marker's lifecycle, the ADBC execute_update guard and its bound-row cleanup, and NAPI close() cancelling a call that is still running. Each binding has matching tests.

Other findings

  • ⚪ Nit — pyo3/Cargo.toml adds tokio-util only to reach tokio_util::bytes::Bytes. Depending on bytes = "1" directly would state that dependency more clearly. (Found by Claude Opus 5.5 · the judge disputed it but couldn't back that up, so it's kept)

Comment thread tests/v0_c_abi_canceller_wiremock.rs Resolved

@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 Medium · 1 Low · 1 Nit

Looks good: 2 low concerns. The Volume options, markers and local error details reach each binding consistently and have targeted wiremock tests. NAPI's close() now cancels before closing, which matches what the docs describe.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge and GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Other findings

  • ⚪ Nit — The new is_volume_operation accessors leave out untouched on error paths, unlike sibling accessors such as status, which write a default first. Write false to a non-null out before validating the handle. (Found by GPT-6.1 Sol · confirmed by the judge)
  • 🟡 Medium — Awaiting the detached canceller waits for the server cancel RPC even after local cancellation releases the transfer's lock, so a slow or retrying cancel endpoint can still stall close despite the transfer having stopped. Dispatch cancellation independently or race it against acquiring inner, allowing close to proceed once the in-flight operation releases its lock. (Found by GPT-6.1 Sol · the judge couldn't confirm it)
🔀 1 finding considered and dismissed by the judge
  • 🔵 Low src/c_abi/error.rs:176 — The three new kernel_get_last_error_* getters are extern "C" functions that do not use catch_ffi, unlike the other new entry points. A panic in them, for
    Judge's evidence: LAST_ERROR.with(|cell| cell.borrow().local_os_error)

Comment thread adbc/src/statement.rs Resolved
aakash-saravanan-db and others added 8 commits December 3, 2026 20:13
… PyO3

Each binding sets StatementSpec::volume before executing, so a Volume
PUT, GET or REMOVE runs its file transfer inside the execution, and the
binding's existing cancel and close paths stop it.

- C ABI: kernel_statement_set_volume_options, the is_volume_operation
  flags on executed statements and result streams, and the last-error
  code, OS error and local path accessors.
- PyO3: Statement.set_volume_options with optional upload bytes taken
  without copying, is_volume_operation, and local error attributes on
  KernelError.
- NAPI: ExecuteOptions.volume, isVolumeOperation and local error fields;
  socketTimeoutMs 0 keeps the kernel default, and AsyncStatement.close()
  cancels a call that still holds the statement.
- ADBC: the staging_allowed_local_paths statement option; execute_update
  on a Volume statement without it fails with InvalidState.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
The test parks awaitResult() on a stalled Volume GET and checks that
close() cancels it and returns. Also drops a blank line left in the C
header.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
kernel_executed_async_statement_is_volume_operation reports whether the
last status poll succeeded for a statement the server marks as a Volume
PUT, GET or REMOVE. Reading its result stream runs the file transfer, so a
host that polls an async statement can run only that read off its polling
thread and return any other result on the same poll.

The get_result_stream doc now says it runs the transfer.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
is_volume_operation now checks owner_released, as take_pending_result does,
so it cannot report a status response the released owner no longer serves.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
… trip

A C ABI test sets the Volume options on a live statement, checks that a GET
writes the file, and checks that a missing PUT source reports its error code,
OS error and path to the calling thread. The ADBC test now reads the option
back, clears it with JSON null and rejects other JSON, as the README says.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
…rker

kernel_executed_async_statement_is_volume_operation now checks the handle's
validity, as kernel_executed_statement_is_volume_operation does, so after
the parent statement is re-executed or closed it reports
InvalidStatementHandle instead of a cached marker.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
close() awaited the server cancel request before taking the statement, so a
slow or retrying cancel endpoint held it after the transfer had already
stopped locally. The cancel now runs as its own task. The C ABI
is_volume_operation accessors also write false to out before reporting an
error, as get_result_stream writes null.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@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 — 2 low concerns. The bindings forward the Volume options consistently, and tests cover the main transfer, error-detail and cancel paths.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge — see the findings below.

🔀 1 finding considered and dismissed by the judge
  • 🔵 Low napi/src/async_statement.rs:391 — close() now cancels the server statement whenever try_lock fails, so any call holding inner triggers it, including a short status() poll. It also uses t
    Judge's evidence: // A call still running holds 'inner' until it returns, such as an

Comment thread src/c_abi/statement.rs Resolved
…eams

The live GET now reads kernel_executed_statement_is_volume_operation and
kernel_result_stream_is_volume_operation on the stream borrowed from the
executed handle, and the async test reads it on the stream the async read
owns, so both stream shapes are covered.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@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).

✅ No issues identified.

🔀 3 findings considered and dismissed by the judge
  • 🔵 Low napi/src/async_statement.rs:402 — close() starts the cancel with ambient tokio::spawn, while Drop in the same file uses runtime::try_get_handle(). The cancel also fires whenever any call
    Judge's evidence: tokio::spawn(async move { let _ = in_flight.cancel().await; });
  • 🔵 Low src/statement/executed_async.rs:588 — pending_result.lock().is_ok_and(...) turns a poisoned mutex into Ok(false), so the C ABI reports a non-Volume statement and the host may run the transfer-be
    Judge's evidence: let mut pending = self.pending_result.lock().ok()?;
  • 🔵 Low adbc/src/statement.rs:920 — In the bound-row path, when require_staging_option fails, the successfully executed statement is dropped without an explicit executed.close(), so cleanup re
    Judge's evidence: // The kernel closes dropped executed handles asynchronously. Waiting drop(executed);

This branch was successfully deployed

1 active deployment
azure-prod — 7a5f9f71 Deployed Dec 3, 2026 by aakash-saravanan-db via followup #5239
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.

2 participants