[FIXED] Consumer with overlapping filter subjects but not subset#7810
Merged
neilalexander merged 1 commit intomainfrom Feb 9, 2026
Merged
[FIXED] Consumer with overlapping filter subjects but not subset#7810neilalexander merged 1 commit intomainfrom
neilalexander merged 1 commit intomainfrom
Conversation
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
wallyqs
pushed a commit
to wallyqs/nats-server
that referenced
this pull request
Feb 9, 2026
Detailed review of the change from SubjectsCollide to subjectIsSubsetMatch for consumer filter subject validation. Confirms the change is safe with respect to duplicate delivery, NumPending counting, and work-queue consumers. https://claude.ai/code/session_01KQLYhCHEvYZXFtHLaoCo4C
wallyqs
pushed a commit
to wallyqs/nats-server
that referenced
this pull request
Feb 9, 2026
Apply the production change from PR nats-io#7810 (SubjectsCollide -> subjectIsSubsetMatch) and add comprehensive test coverage: - TestJetStreamConsumerAllowOverlappingSubjectsIfNotSubset: original PR test verifying two-way overlap with delivery correctness (7 unique messages) - TestJetStreamConsumerOverlappingSubjectsThreeWay: three overlapping-but-not- subset filters confirming 10 unique messages with no duplicates - TestJetStreamConsumerSubsetFiltersStillRejected: table-driven tests covering 5 reject cases (fwc/pwc subset relationships) and 4 allow cases (cross- wildcard, triple-cross, disjoint literals/wildcards) Also updates the comment at consumer.go:822 to reflect the new semantics. https://claude.ai/code/session_01KQLYhCHEvYZXFtHLaoCo4C
wallyqs
pushed a commit
to wallyqs/nats-server
that referenced
this pull request
Feb 9, 2026
Apply the production change from PR nats-io#7810 (SubjectsCollide -> subjectIsSubsetMatch) and add comprehensive test coverage: - TestJetStreamConsumerAllowOverlappingSubjectsIfNotSubset: original PR test verifying two-way overlap with delivery correctness (7 unique messages) - TestJetStreamConsumerOverlappingSubjectsThreeWay: three overlapping-but-not- subset filters confirming 10 unique messages with no duplicates - TestJetStreamConsumerSubsetFiltersStillRejected: table-driven tests covering 5 reject cases (fwc/pwc subset relationships) and 4 allow cases (cross- wildcard, triple-cross, disjoint literals/wildcards) Also updates the comment at consumer.go:822 to reflect the new semantics. https://claude.ai/code/session_01KQLYhCHEvYZXFtHLaoCo4C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A consumer should be allowed to have filter subjects like
event.foo.*andevent.*.foo. They do collide but one isn't a subset of the other, but it currently fails as having overlapping subjects. This PR relaxes this check by allowing this former case, but still preventing having filter subjects likeevent.>andevent.foo/event.*.foo/etc. since those are subsets (which was maybe too eagerly changed in #5224, as it used to besubjectIsSubsetMatchbefore).Resolves #7779
Signed-off-by: Maurice van Veen github@mauricevanveen.com