Skip to content

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

Open
aakash-saravanan-db wants to merge 2 commits into
aakash-saravanan_data/feat/volume-core-rebuild-20261201from
aakash-saravanan_data/feat/volume-bindings-rebuild-20261201
Open

aakash-saravanan-db wants to merge 2 commits into
aakash-saravanan_data/feat/volume-core-rebuild-20261201from
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_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
  • 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.

Stacked on #520. Supersedes #513.

Testing

Run locally, because CI runs these suites only for pull requests against main. fmt, clippy with -D warnings and the tests pass: root 1,419, NAPI 96, ADBC 102, and PyO3 32 Rust and 33 Python tests (live tests skipped). make c-abi-test passes.

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;
  • the ADBC InvalidState and cancel paths;
  • 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: 2 Low

Looks good, with 1 low concern. I checked the completion wiring on each ADBC execution path, the C ABI cancel/select handling and field-projected borrows, the NAPI cancel/close handoff and the error accessors, and found no correctness problems.

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

Comment thread adbc/src/statement.rs Resolved
Comment thread pyo3/src/session.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).

✅ No issues identified.

🔀 2 findings considered and dismissed by the judge
  • 🔵 Low src/c_abi/result.rs:672 — out is only written on success, so a C caller that reads it after Cancelled or another error sees whatever was in uninitialized stack memory. The new _is_v<br>Judge's evidence: std::ptr::write(out, outcome);`
  • 🔵 Low adbc/src/statement.rs:628 — expect("paths serialize") can panic inside the driver: PathBuf serialization fails on non-UTF-8 paths. Today the paths always come from parsed JSON, so it c
    Judge's evidence: serde_json::to_string(&options.allowed_paths).expect("paths serialize")

@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. I found 2 low-severity test-coverage gaps and no correctness issues. Volume completion, cancellation and the error fields are wired the same way in the C ABI, ADBC, NAPI and PyO3, and each binding has tests.

Other findings

  • ⚪ Nit — The test discards the status codes from kernel_result_stream_is_volume_operation and kernel_result_stream_canceller_new. A failure would surface later as a confusing assertion or a null canceller. Assert KernelStatusCode::Success on both calls. (Found by Claude Opus 5.5 · confirmed by the judge)

Comment thread src/c_abi/session.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 2 low concerns. I checked the cancel paths across the bindings: the C enum values match #[repr(C)] VolumeCompletion, and ADBC's cancel handle reaches cancel_volume_operation on both of its branches.

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.

Other findings

  • ⚪ Nit — The PyO3 wrapper copies the whole PUT upload with to_vec() while the GIL is held, because the kernel takes Option<Vec<u8>>, so a large upload briefly needs twice the memory. Accept the copy or change the kernel API to take shared bytes. Either way, note it in the docstring. (Found by Claude Opus 5.5 · confirmed by the judge)
🔀 1 finding considered and dismissed by the judge
  • 🔵 Low pyo3/src/session.rs:241 — In PyO3 a positive request_timeout_secs also sets the transfer idle limit, and 0 keeps the 15-minute default, so Python callers can't turn the limit off or
    Judge's evidence: /// (120 seconds). A positive value is also the idle limit for Volume file /// transfers, which otherwise default to 15 …

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

🔀 1 finding considered and dismissed by the judge
  • 🔵 Low src/c_abi/error.rs:182 — The three new kernel_get_last_error_* entry points are extern "C" functions that run Rust code (a RefCell::borrow inside LAST_ERROR.with) without a cat<br>Judge's evidence: pub unsafe extern "C" fn kernel_get_last_error(out: *mut KernelError) -> bool {`

@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

Looks good, with 2 low concerns. Each binding wires Volume completion consistently, the C ABI enum layout matches (repr(C) 0/1/2), and the cancel paths are covered by tests in the ADBC, NAPI and C ABI layers.

Comment thread src/c_abi/statement.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 Low

Looks good — no blocking issues found. Cancellation reaches the transfer on every path I checked: the ADBC dispatch and blocking paths, the NAPI canceller, and the C ABI select. The C enum is repr(C) with matching discriminants, and tests cover each binding.

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

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: 3 low-severity concerns, no blockers. Cancellation reaches running transfers in every binding, the C enum is #[repr(C)] with matching discriminants, and the error accessors are covered by tests.

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 — No test sets the staging option on execute() with a bound row. That path goes through SequenceReader and execute_bound_row, one transfer per row. Add a case that binds a row, calls execute() and checks the transfer ran and the instruction row is readable. (Found by Claude Opus 5.5 · confirmed by the judge)
🔀 1 finding considered and dismissed by the judge
  • 🔵 Low src/c_abi/result.rs:672 — kernel_result_stream_complete_volume_operation leaves *out unwritten on every error path (bad JSON, invalidated exec, Cancelled, transfer failure). A C call
    Judge's evidence: Ok(outcome) => { std::ptr::write(out, outcome); KernelStatusCode::Success }

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

Looks good: 2 low concerns. The bindings wire Volume completion, cancellation and the timeout mapping consistently, with tests at each tier. VolumeCompletion is repr(C), which matches the header enum.

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 three new kernel_get_last_error_* exports call LAST_ERROR.with without catch_ffi. They match the existing kernel_get_last_error, and the only way to panic is TLS access during thread teardown, so this is theoretical. Use try_with and return NULL or 0 if you want it hardened. (Found by Claude Opus 5.5 · confirmed by the judge)

Comment thread adbc/src/statement.rs Resolved
Comment thread napi/src/database.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 Low

Looks good, with 1 low concern. I checked the Volume completion wiring in the C ABI, ADBC, NAPI and PyO3 bindings: the C enum matches the Rust layout, a zero idle limit means no limit, and ADBC cancel stops the transfer through the kernel canceller.

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: 2 Low

Looks good, with one low-severity test-coverage gap. Volume completion and cancellation are wired consistently across the C ABI, ADBC, NAPI and PyO3. The KernelVolumeCompletion enum layout matches its repr(C) Rust definition, and a cancelled GET drops its temp file through TempPath.

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

Comment thread src/c_abi/result.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 Low

Looks good: one low concern. C ABI, PyO3, NAPI and ADBC each wire Volume completion, cancellation and the idle timeout consistently. A cancel drops the transfer future, which is safe because temp files only persist once the transfer finishes. Each binding has tests for its new paths.

Comment thread pyo3/src/result_stream.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

Looks good overall, with 3 low concerns. Volume completion and cancellation are wired consistently across the C ABI, ADBC, NAPI and PyO3. The remaining gaps are binding parity for error kinds and test coverage for a few new entry points.

Comment thread src/c_abi/statement.rs Resolved
Comment thread pyo3/src/errors.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: 2 Low

Looks good, with 2 low concerns. The bindings wire Volume completion and cancellation consistently. The ADBC cancel path stops a transfer both during and after the blocking execute.

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
  • 🟡 Medium napi/src/async_statement.rs:491 — Closing the parent during completion can permanently retain the result stream and its session resources: completion holds this mutex across the transfer, while
    Judge's evidence: // A stream held by an in-flight fetch is left; close doesn't wait.

Comment thread adbc/src/config.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 Low · 1 Nit

Looks good, with one low-severity test-coverage gap. Cancellation, the C ABI enum layout, the timeout mappings and the ADBC option handling are consistent across the bindings.

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 napi test never exercises Statement.cancel() stopping a running transfer. The sync close=false case calls execution.cancel() instead. Add a case that calls statement.cancel() while completeVolumeOperation runs. (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 Nit

Looks good: 2 low concerns, no blockers. Cancellation is wired through each binding: the ADBC handle, the NAPI cancel/close/Drop paths and the C ABI select all stop the transfer, and an interrupted GET leaves no partial file because downloads go to a temp file first.

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.

Other findings

  • ⚪ Nit — NAPI exposes localErrorKind, but PyO3 and the C ABI expose only errno and path. For local errors with no errno, such as UnexpectedEof, those callers cannot tell what failed. Expose the kind there too, or document the difference. (Found by Claude Opus 5.5 · confirmed by the judge)
🔀 1 finding considered and dismissed by the judge
  • 🔵 Low src/c_abi/result.rs:673 — out is written only on success, so a caller that checks it after a Cancelled or JSON error reads whatever was there before. Write KernelVolumeCompletion_No<br>Judge's evidence: Ok(outcome) => { std::ptr::write(out, outcome); KernelStatusCode::Success`

@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 — 1 low concern. Cancel paths, the FFI enum layout (repr(C), 0/1/2) and zero-timeout semantics all line up across the C ABI, ADBC, NAPI and PyO3. Each binding has tests for the new behavior.

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 field doc mentions Some(None), but the field is Option<Duration> and the setter stores Some(Duration::from_millis(0)) for no limit. Change the doc to say Some(Duration::ZERO) sets no limit. (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 Low · 1 Nit

Looks good, with 2 low concerns. Each binding's cancel path calls into the kernel's volume cancel, and each binding has tests that run the completion and cancel mid-transfer. The remaining issues are a wrong doc comment in the C ABI and binding-specific meanings for a zero timeout.

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 field comment mentions Some(None), but the field is Option<Duration>, and no limit is stored as Some(Duration::ZERO). Reword the comment to say Some(Duration::ZERO) sets no limit. (Found by Claude Opus 5.5 · confirmed by the judge)
🔀 1 finding considered and dismissed by the judge
  • 🔵 Low napi/src/database.rs:687 — In NAPI, socketTimeoutMs: 0 removes the transfer idle limit (None). In PyO3, request_timeout_secs=0 keeps the 15-minute default. So the same 'zero timeout
    Judge's evidence: Some(0) => http.storage_read_timeout = None,

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 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
… 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>

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

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

let taken = {
let mut guard = inner.lock().await;
guard.take()
let taken = match inner.try_lock() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — close() sends a server-side cancel whenever try_lock fails. That includes a brief status() or numModifiedRows() call, not only a long awaitResult(). The statement is closed right after, so the effect is an extra cancel RPC. The racing-second-close case in the report doesn't apply, because the first close drops the inner lock before its close RPC. Fix: only cancel when a long-running call is in flight, for example by tracking an awaiting flag.

🔀 Found by Claude Opus 5.5 · confirmed by the judge

This branch was successfully deployed

1 active deployment
azure-prod — 4471d5cd Deployed Dec 3, 2026 by oss-reviewer-bot[bot] via followup #5157
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.

1 participant