Skip to content

keep_matching in OnMatch to skip matched Matchers#117

Merged
markdroth merged 3 commits into
cncf:mainfrom
bsurber:keep_matching-in-xds
May 1, 2025
Merged

keep_matching in OnMatch to skip matched Matchers#117
markdroth merged 3 commits into
cncf:mainfrom
bsurber:keep_matching-in-xds

Conversation

@bsurber

@bsurber bsurber commented Mar 13, 2025

Copy link
Copy Markdown
Contributor

Add a keep_matching field to OnMatch which indicates to callers that it should not enforce the matcher's action and instead continue looking for another match, if possible.
If a match continuation isn't possible or does not find a further match, on_no_match action will be used.

CC @markdroth

bsurber added 2 commits March 13, 2025 16:00
…it should not enforce the matcher's action and instead continue looking for another match if possible

Signed-off-by: Brian Surber <[email protected]>
@bsurber
bsurber force-pushed the keep_matching-in-xds branch from 2e66edd to 42edf51 Compare March 13, 2025 16:01
@markdroth

Copy link
Copy Markdown
Contributor

This LGTM, but I'll hold off on merging until we get consensus on envoyproxy/envoy#38726.

@bsurber

bsurber commented Apr 17, 2025

Copy link
Copy Markdown
Contributor Author

This LGTM, but I'll hold off on merging until we get consensus on envoyproxy/envoy#38726.

Now that we have consensus on the desired behavior, are we clear to submit this? It'll help clean up the CI + dependency management in the dependent PR.

@markdroth

Copy link
Copy Markdown
Contributor

@markdroth

Copy link
Copy Markdown
Contributor

Please fix DCO.

@bsurber
bsurber force-pushed the keep_matching-in-xds branch from 6ffc1e2 to a43e4bf Compare May 1, 2025 22:55
@markdroth
markdroth merged commit 2ac532f into cncf:main May 1, 2025
ravenblackx added a commit to envoyproxy/envoy that referenced this pull request May 28, 2025
…38726)

Commit Message:
- Add a `keep_matching` field to OnMatch to mark Matchers that should be
recorded when matched but should not be the final matched + enforced
action.
- Implement support for `keep_matching` using MatcherTree re-entry.
- Re-entry is implemented in PR #38564 as well for a separate review if
this PR gets closed.
- ListMatcher was chosen as the simplest example usecase /
proof-of-concept for re-entry, but implementation in other MatcherTree
children will follow in separate PRs (namely prefix_map_matcher).
- Centralize recursion handling & re-entry logic into
`evaluateMatch(...)`, leaving each MatchTree child class to implement
the simplest possible `match(...)` logic (find a match and return it +
optionally a reentrant).
- Previously recursion handling was inconsistent across the MatchTree
children, and this saves each child from having to re-implement
recursion, `keep_handling` processing, etc.
- TrieMatcher also required a reentrant implementation as part of moving
recursion logic out of its `match(...)` logic.


Additional Description:
- The final goal is to implement preview / darklaunch Matchers whose
actions are logged or added to metadata, but not enforced.
- An initial implementation of preview matched actions just using
re-entry was drafted for the rate_limit_quota filter in PR #38576,
prompting the request to instead add this `keep_matching` feature to the
Matcher API for re-usability.
- This change will also depend on a duplicate, matcher proto change in
[github.com/cnf/xds](cncf/xds#117).

Risk Level: moderate - includes changes to widely-used libraries
Testing: Unit + Integration testing, loadtesting WIP
Docs Changes:
Release Notes:
Platform Specific Features:
~[Optional Runtime guard:]~
~[Optional Fixes #Issue]~
~[Optional Fixes commit #PR or SHA]~
~[Optional Deprecated:]~
[API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):
The new `keep_matching` field is not marked as WIP as its implementation
should be tested for any breaking changes.

---------

Signed-off-by: Brian Surber <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Co-authored-by: Raven Black <[email protected]>
update-envoy Bot added a commit to envoyproxy/data-plane-api that referenced this pull request Jul 2, 2025
…38726)

Commit Message:
- Add a `keep_matching` field to OnMatch to mark Matchers that should be
recorded when matched but should not be the final matched + enforced
action.
- Implement support for `keep_matching` using MatcherTree re-entry.
- Re-entry is implemented in PR #38564 as well for a separate review if
this PR gets closed.
- ListMatcher was chosen as the simplest example usecase /
proof-of-concept for re-entry, but implementation in other MatcherTree
children will follow in separate PRs (namely prefix_map_matcher).
- Centralize recursion handling & re-entry logic into
`evaluateMatch(...)`, leaving each MatchTree child class to implement
the simplest possible `match(...)` logic (find a match and return it +
optionally a reentrant).
- Previously recursion handling was inconsistent across the MatchTree
children, and this saves each child from having to re-implement
recursion, `keep_handling` processing, etc.
- TrieMatcher also required a reentrant implementation as part of moving
recursion logic out of its `match(...)` logic.

Additional Description:
- The final goal is to implement preview / darklaunch Matchers whose
actions are logged or added to metadata, but not enforced.
- An initial implementation of preview matched actions just using
re-entry was drafted for the rate_limit_quota filter in PR #38576,
prompting the request to instead add this `keep_matching` feature to the
Matcher API for re-usability.
- This change will also depend on a duplicate, matcher proto change in
[github.com/cnf/xds](cncf/xds#117).

Risk Level: moderate - includes changes to widely-used libraries
Testing: Unit + Integration testing, loadtesting WIP
Docs Changes:
Release Notes:
Platform Specific Features:
~[Optional Runtime guard:]~
~[Optional Fixes #Issue]~
~[Optional Fixes commit #PR or SHA]~
~[Optional Deprecated:]~
[API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):
The new `keep_matching` field is not marked as WIP as its implementation
should be tested for any breaking changes.

---------

Signed-off-by: Brian Surber <[email protected]>
Signed-off-by: Raven Black <[email protected]>
Co-authored-by: Raven Black <[email protected]>

Mirrored from https://github.com/envoyproxy/envoy @ 426cd861187368163b42fce910ab5828f7f0b392
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.

2 participants