Skip to content

feat: compile-time feature-gated Rust backtrace for JNI error diagnostics#6365

Open
summaryzb wants to merge 1 commit intolance-format:mainfrom
summaryzb:log_throw
Open

feat: compile-time feature-gated Rust backtrace for JNI error diagnostics#6365
summaryzb wants to merge 1 commit intolance-format:mainfrom
summaryzb:log_throw

Conversation

@summaryzb
Copy link
Copy Markdown

@summaryzb summaryzb commented Mar 31, 2026

No regression for release builds, Python layer also can reuse this mechanism

The overall design employs a two-tiered strategy of "compile-time switching + runtime gating":

  1. Compile-time switching: Two versions of the MaybeBacktrace type are defined through conditional compilation using #[cfg(feature = "backtrace")], when the feature is disabled error size, layout, and runtime behavior are unchanged as before

  2. Runtime Gating: With the backtrace feature enabled, actual backtrace capture is still controlled by the runtime environment variable RUST_BACKTRACE=1

  3. Java integration: The transformation logic calls err.backtrace() to obtain an optional backtrace. If exists, it is passed to the corresponding Java exception class. Users can enable this feature during Maven builds using -Drust.features=backtrace.

@github-actions github-actions bot added the java label Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

ACTION NEEDED
Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

@summaryzb summaryzb changed the title feat compile-time feature-gated Rust backtrace for JNI error diagnostics feat: compile-time feature-gated Rust backtrace for JNI error diagnostics Mar 31, 2026
@github-actions github-actions bot added the enhancement New feature or request label Mar 31, 2026
@summaryzb
Copy link
Copy Markdown
Author

@hamersaw PTAL

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 24 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance-core/src/error.rs 62.50% 24 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

enhancement New feature or request java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant