Skip to content

fix(operator-api): log the specific failure in dora_read_data instead… - #3246

Open
GuTS805 wants to merge 1 commit into
dora-rs:mainfrom
GuTS805:fix/operator-ffi-read-data-diagnostics
Open

fix(operator-api): log the specific failure in dora_read_data instead…#3246
GuTS805 wants to merge 1 commit into
dora-rs:mainfrom
GuTS805:fix/operator-ffi-read-data-diagnostics

Conversation

@GuTS805

@GuTS805 GuTS805 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Three unrelated failure modes (input already consumed, malformed Arrow FFI schema, non-UInt8 payload type) collapsed into an indistinguishable None with zero diagnostics. The equivalent C node-API function (read_dora_input_data) already logs the failing Arrow type via tracing::error! - this brings the operator-side twin to parity.

A C/C++ operator receiving a routine non-byte input from an upstream Rust/Python node (not a corner case - every other FFI accessor in the C/C++ surface already handles and logs this, tracked as #2030) got a silent empty payload with no way to tell apart 'input was empty', 'already read this input', 'type mismatch', or 'malformed FFI schema'.

Documented as a known-but-unfiled Medium finding in the internal 2026-06-04 soundness audit; the sibling leak in examples/c-dataflow/operator.c was already fixed separately, but this diagnostics gap was not.

Rebased onto current upstream main (was accidentally branched off a 206-commits-stale fork main) and adapted to the DoraArray/internal::from_array_data rename from #3213.

… of silently returning None

Three unrelated failure modes (input already consumed, malformed Arrow
FFI schema, non-UInt8 payload type) collapsed into an indistinguishable
None with zero diagnostics. The equivalent C node-API function
(read_dora_input_data) already logs the failing Arrow type via
tracing::error! - this brings the operator-side twin to parity.

A C/C++ operator receiving a routine non-byte input from an upstream
Rust/Python node (not a corner case - every other FFI accessor in the
C/C++ surface already handles and logs this, tracked as dora-rs#2030) got a
silent empty payload with no way to tell apart 'input was empty',
'already read this input', 'type mismatch', or 'malformed FFI schema'.

Documented as a known-but-unfiled Medium finding in the internal
2026-06-04 soundness audit; the sibling leak in
examples/c-dataflow/operator.c was already fixed separately, but this
diagnostics gap was not.

Rebased onto current upstream main (was accidentally branched off a
206-commits-stale fork main) and adapted to the DoraArray/
internal::from_array_data rename from dora-rs#3213.
@trunk-io

trunk-io Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

Copy link
Copy Markdown
Collaborator

Reviewed the diff. The refactor from the ?/.ok()? chain into explicit let-else/match branches is behavior-equivalent — every failure path still returns None, so there's no change for existing C/C++ operators; the only addition is the tracing::error! diagnostics (and the tracing dependency, which is declared in both Cargo.toml and Cargo.lock). The .unwrap()s are confined to the test helper.

The two added tests assert on real behavior (Int32 input → None via the TryFrom branch; double-read → first Some, second None). The Arrow-FFI-import-failure branch isn't directly covered, but that's a minor gap rather than a problem.

No issues found.


🤖 Fully automated review by Claude (Claude Code) — no human in the loop. Advisory only; please verify before acting.


Generated by Claude Code

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