Skip to content

GH-3628: prevent NPE & unclosed releaser#3629

Open
nastra wants to merge 1 commit into
apache:masterfrom
nastra:fix-npe
Open

GH-3628: prevent NPE & unclosed releaser#3629
nastra wants to merge 1 commit into
apache:masterfrom
nastra:fix-npe

Conversation

@nastra

@nastra nastra commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

ColumnChunkPageReadStore.close() NPEs if setReleaser() was never called. Also it's possible that the releaser itself isn't closed when releasing the buffers of the readers fails anywhere in the loop

Closes #3628

What changes are included in this PR?

Are these changes tested?

added a test that reproduces both cases

Are there any user-facing changes?

@nastra

nastra commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/cc @Fokko @wgtmac

store.addColumn(COLUMN, newReaderWithoutPages(options));

// setReleaser() is intentionally NOT called here.
store.close();

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.

having AssertJ (#3616) would make testing this a bit easier and more explicit, because we could then just say assertThatCode(store::close).doesNotThrowAnyException()


try {
store.close();
throw new AssertionError("Expected close() to propagate the reader failure");

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.

AssertJ would also simplify testing this error condition. We would end up having assertThatThrownBy(store::close).isInstanceof(...).hasMessage(...)

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.

ColumnChunkPageReadStore.close() NPEs if setReleaser() was never called, skipping buffer cleanup in finally

1 participant