Skip to content

fix(java): type scanner operation failures - #8184

Merged
Xuanwo merged 1 commit into
mainfrom
gatekeeper/fix-7611-1
Aug 4, 2026
Merged

fix(java): type scanner operation failures#8184
Xuanwo merged 1 commit into
mainfrom
gatekeeper/fix-7611-1

Conversation

@lance-gatekeeper

Copy link
Copy Markdown
Contributor

Summary

  • add a documented LanceException unchecked exception for operation failures
  • wrap synchronous and asynchronous scanner failures with the typed exception
  • cover the native async failure callback with a regression test

Root cause

LanceScanner and AsyncScanner converted scanner I/O and native-operation failures into bare RuntimeException instances. Callers therefore could not distinguish Lance operation failures from unrelated programming errors.

Validation

  • ./mvnw -Dtest=AsyncScannerTest#testNativeScanFailureUsesLanceException test (passes; JNI Rust unit tests also pass)
  • ./mvnw spotless:check (passes)
  • cargo fmt --manifest-path ./lance-jni/Cargo.toml --all (passes)
  • ./mvnw -Djava.io.tmpdir=/home/repo/java/target/test-tmp test (397 passed, 26 skipped; one existing forked-JVM classloader test fails because its child JVM extracts JNI libraries to the non-executable /tmp mount)

Fixes #7611

@github-actions github-actions Bot added A-java Java bindings + JNI bug Something isn't working labels Aug 3, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Gate recommendation: approve.

The change establishes a compatible typed failure boundary for synchronous stream creation and asynchronous native/import failures while preserving available causes and leaving programming-state exceptions distinct. A checked exception cannot fit Arrow’s Scanner override or CompletableFuture, and a global JNI remap would alter unrelated APIs, so the focused Java-boundary wrapper is the preferable mechanism.

@Xuanwo
Xuanwo merged commit 764e728 into main Aug 4, 2026
11 checks passed
@Xuanwo
Xuanwo deleted the gatekeeper/fix-7611-1 branch August 4, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-java Java bindings + JNI bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] LanceScanner/AsyncScanner wraps IOException as bare RuntimeException

1 participant