Skip to content

[fix][meta] Fix NPE in shouldIgnoreEvent when MetadataEvent options is null#26200

Merged
nodece merged 1 commit into
apache:masterfrom
SongOf:fix/metadata-event-null-options-npe
Jul 20, 2026
Merged

[fix][meta] Fix NPE in shouldIgnoreEvent when MetadataEvent options is null#26200
nodece merged 1 commit into
apache:masterfrom
SongOf:fix/metadata-event-null-options-npe

Conversation

@SongOf

@SongOf SongOf commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Motivation

AbstractMetadataStore#shouldIgnoreEvent normalizes a possibly-null
MetadataEvent#getOptions() into a local options variable
(options = event.getOptions() != null ? event.getOptions() : Collections.emptySet()),
but the ephemeral/sequential check on the next lines only used it for the first half of
the condition:

if (options.contains(CreateOption.Ephemeral) || event.getOptions().contains(CreateOption.Sequential)) {

When a synchronizer delivers a MetadataEvent whose options is null and the metadata
is not Ephemeral, the short-circuit falls through to
event.getOptions().contains(...) and throws a NullPointerException, so the event
fails to be processed instead of being handled by the remaining checks.

Modifications

Use the null-normalized local options variable for the CreateOption.Sequential
check as well, matching the CreateOption.Ephemeral check on the same line. No
behavior change other than removing the NPE path.

@void-ptr974 void-ptr974 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.

LGTM.

@nodece
nodece merged commit 0ca94f5 into apache:master Jul 20, 2026
44 checks passed
@nodece nodece added this to the 5.0.0-M2 milestone Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants