Skip to content

Lucene: preserve throwable types in accelerated vector formats - #2515

Open
shaunakkapur wants to merge 3 commits into
NVIDIA:mainfrom
shaunakkapur:codex/lucene-propagate-errors
Open

Lucene: preserve throwable types in accelerated vector formats#2515
shaunakkapur wants to merge 3 commits into
NVIDIA:mainfrom
shaunakkapur:codex/lucene-propagate-errors

Conversation

@shaunakkapur

@shaunakkapur shaunakkapur commented Aug 27, 2026

Copy link
Copy Markdown

Summary

Replace the broad RuntimeException wrappers in fieldsWriter and fieldsReader across the plain, scalar quantized, and binary quantized accelerated vector formats with Utils.handleThrowable.

This preserves IOException, RuntimeException, and Error instances instead of discarding their type, cause, and stack information. It also documents and tests the shared Error propagation contract.

Add focused helper and vector format regression coverage. The call site tests verify that IOException and RuntimeException instances are propagated unchanged, while the helper test verifies exact Error identity.

Testing

  • TestUtilsThrowableHandling: 4 tests passed
  • TestAcceleratedHNSWVectorsFormatThrowableHandling: 3 tests passed
  • Spotless check passed
  • git diff check passed

The call site tests were also run against the previous wrappers and correctly failed for IOException and RuntimeException identity.

Closes #2474

@copy-pr-bot

copy-pr-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@shaunakkapur

Copy link
Copy Markdown
Author

/ok to test e3b67f1

@shaunakkapur shaunakkapur changed the title Lucene: add Error propagation regression coverage Lucene: preserve throwable types in accelerated vector formats Aug 27, 2026
@shaunakkapur

Copy link
Copy Markdown
Author

/ok to test 358def4

@shaunakkapur
shaunakkapur marked this pull request as ready for review August 27, 2026 23:08
@shaunakkapur
shaunakkapur requested a review from a team as a code owner August 27, 2026 23:08
@imotov imotov added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Aug 27, 2026
@shaunakkapur
shaunakkapur marked this pull request as draft August 28, 2026 02:01
@shaunakkapur
shaunakkapur marked this pull request as ready for review August 28, 2026 02:12

@imotov imotov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. Left one comment.

} catch (Exception e) {
throw new RuntimeException(e.getMessage());
Utils.handleThrowable(e);
throw new AssertionError("handleThrowable always throws"); // unreachable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we need these assertions. You already have assertThrows in the test, and it ensures that we don't swallow an exception in these methods.

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

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lucene: Propagate Error subclasses unchanged instead of indiscriminately wrapping in RuntimeException

2 participants