Repository navigation
fix: prevent filter corruption and reconcile loop in Gateway API session affinity - #1990
Open
okarin1511 wants to merge 1 commit into
Open
okarin1511 wants to merge 1 commit into
okarin1511 wants to merge 1 commit into
Conversation
…ion affinity Two bugs in the Gateway API session affinity implementation: 1. Shallow copy of HTTPRouteRule shares the Filters slice backing array. When append is called in the canaryWeight == 0 branch, it can corrupt the weighted route rule's filters if spare capacity exists. Fix by copying the Filters slice explicitly. 2. The v1beta1 reconcile diff only ignores the canary cookie route rule but not the primary cookie route rule. This causes an unnecessary update on every reconcile cycle when PrimaryCookieName is set. Fix by matching the v1 implementation which correctly ignores both canary and primary cookie routes. Signed-off-by: Aseem Khandekar <69676297+okarin1511@users.noreply.github.com>
This branch has not been deployed
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.
Fixes #1989
Summary
Two bugs in Gateway API session affinity:
Filter slice corruption: Shallow copy of
HTTPRouteRuleshares theFiltersslice backing array with the source.appendin thecanaryWeight == 0branch can corrupt the weighted route rule's filters when spare capacity exists. Fixed by explicitly copying the Filters slice after the struct copy.v1beta1 infinite reconcile loop: The v1beta1 reconcile diff only ignores the canary cookie route rule, not the primary cookie route. When
PrimaryCookieNameis set, the primary sticky route causes a diff on every cycle, triggering unnecessary updates. Fixed by matching the v1 implementation which ignores both cookie routes.Test plan