You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "codope (via GitHub)" <gi...@apache.org> on 2026/09/07 08:49:00 UTC

[PR] fix(cpp): catch panics at the FFI boundary so they surface as errors [hudi-rs]

codope opened a new pull request, #766:
URL: https://github.com/apache/hudi-rs/pull/766

   ## Description
   
   cxx's generated shims are `extern "C"`, so a panic reachable from a read (an unsupported Avro type in `avro_to_arrow`, an internal invariant in the log scanner) unwinds out of the shim and aborts the host process. An engine that embeds the library in a long-lived multi-tenant worker loses every co-running query to one bad read.
   
   This wraps each `extern "Rust"` entry point in `catch_unwind` and reports the panic through the `Result` the bridge already throws as `rust::Error`, as `"<entry point> panicked: <message>"`. The call fails; the reader stays usable. The four bridge declarations now document this in the generated header.
   
   Two small side effects:
   
   - `hudi-test` moves to `[dev-dependencies]`; it is only used by the new tests and consumers should not pull the fixture crate.
   - The default panic hook still prints the panic to stderr. Embedders that find that noisy can install their own hook.
   
   The `todo!()`s in `avro_to_arrow` and the scanner `unwrap_*` helpers that the issue lists as panic sources are left for a separate `fix(core)` PR; this one is the safety net at the boundary.
   
   Closes #636. Related: apache/hudi#18308.
   
   ## How are the changes test-covered
   
   - [ ] N/A
   - [x] Automated tests (unit and/or integration tests)
   - [ ] Manual tests
     - [ ] Details are described below
   
   Unit tests in `cpp/src/lib.rs`: the guard for `&str`, `String` and non-string payloads; error paths of each entry point through the real cxx types; a happy-path read of a COW fixture through the bridge; and a panic inside the reader's `block_on` followed by a successful read on the same reader.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(cpp): catch panics at the FFI boundary so they surface as errors [hudi-rs]

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua merged PR #766:
URL: https://github.com/apache/hudi-rs/pull/766


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(cpp): catch panics at the FFI boundary so they surface as errors [hudi-rs]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #766:
URL: https://github.com/apache/hudi-rs/pull/766#issuecomment-5568390588

   ## [Codecov](https://app.codecov.io/gh/apache/hudi-rs/pull/766?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 79.50%. Comparing base ([`06f17bf`](https://app.codecov.io/gh/apache/hudi-rs/commit/06f17bf646ca7f8d76230d86f365f171814720cb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`0ce2185`](https://app.codecov.io/gh/apache/hudi-rs/commit/0ce218557f6d4d02d641a949006ecc582df1e126?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@           Coverage Diff           @@
   ##             main     #766   +/-   ##
   =======================================
     Coverage   79.50%   79.50%           
   =======================================
     Files         126      126           
     Lines       12371    12371           
   =======================================
     Hits         9835     9835           
     Misses       2536     2536           
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/hudi-rs/pull/766?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org