Repository navigation
[RESP] Use iterative glob matching with bounded buffer reads - #2261
Merged
Merged
Conversation
âĶtern matching logic
Contributor
There was a problem hiding this comment.
ðĒ Approval recommended
Static review identified no blocking issues in correctness, buffer bounds, or regression coverage; tests were not executed.
No open issues ð
What changed in this PR
Replaces recursive glob matching with an allocation-free iterative matcher, bounding buffer reads while preserving byte-oriented matching behavior.
Changes:
- Uses constant stack space and length-checked pattern reads.
- Adds matcher, scan, and pub/sub regression coverage.
- Documents wildcard semantics and worst-case matching cost.
| File | Description |
|---|---|
| website/âdocs/âcommands/âgeneric-commands.md | Documents byte matching and complexity. |
| test/âstandalone/âGarnet.test/âRespScanCommandsTests.cs | Tests deep wildcard patterns across scan commands. |
| test/âstandalone/âGarnet.test/âRespPubSubTests.cs | Tests deep patterns in subscriptions and channel listing. |
| test/âstandalone/âGarnet.test/âGlobUtilsTests.cs | Covers syntax, buffer bounds, stack use, and wildcard retries. |
| libs/âserver/âGlobUtils.cs | Implements iterative matching with bounded reads. |
Review effort: Balanced
Tiago NÃĄpoli (tiagonapoli)
approved these changes
Oct 20, 2026
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.
Replace recursive wildcard matching with an allocation-free iterative matcher using constant stack space. Bound pattern reads by the supplied lengths, preserve byte-oriented glob syntax, and add matcher, scan, and pub/sub regression coverage.