-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport of [API Gateway] Fix invalid cluster causing gateway programming delay into release/1.15.x #16668
Merged
andrewstucki
merged 13 commits into
release/1.15.x
from
backport/gateway-long-timeout-fix/accurately-valid-hog
Mar 17, 2023
Merged
Backport of [API Gateway] Fix invalid cluster causing gateway programming delay into release/1.15.x #16668
andrewstucki
merged 13 commits into
release/1.15.x
from
backport/gateway-long-timeout-fix/accurately-valid-hog
Mar 17, 2023
Conversation
This file contains 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
6128a03
to
8717896
Compare
8717896
to
6128a03
Compare
github-team-consul-core-pr-approver
approved these changes
Mar 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto approved Consul Bot automated PR
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.
Backport
This PR is auto-generated from #16661 to be assessed for backporting due to the inclusion of the label backport/1.15.
WARNING automatic cherry-pick of commits failed. Commits will require human attention.
The below text is copied from the body of the original PR.
Description
We were seeing that HTTP listeners on API Gateways were taking ~15 seconds or more to get programmed onto the envoy instances (this also happens on our Kubernetes offering). I finally tracked down what was the root cause. Because we are currently masquerading as ingress gateways for the purposes of xDS generation, the main entrypoint for each HTTP listener is a "virtual" service router, basically one that doesn't correspond to an actual service, but that contains our routing logic based on the rules in an HTTPRoute. What was happening is that when we use such a router, the discovery chain compilation process adds a "fallback target" for when no rules match that targets a service resolver with the same name as the router.
Thus, if our router was named
gateway-listener-12345
-- we were generating a route and resolver node forgateway-listener-12345
. The problem is that our xDS code then generates cluster targets for those services, attempting to resolvegateway-listener-12345.default.default...
or some such hostname. Because we specify that we'll ship the resolved endpoints via EDS over ADS, envoy then blocks on applying its configuration, keeping thegateway-listener-12345
cluster in a warming state. This, in turn, keeps the whole listener in a warming state until the time at which the EDS config source'sinitial_fetch_timeout
value is hit. Since we weren't setting that, this defaults to 15 seconds. So, any use of a virtual router causes an ~15 second delay in applying envoy configuration.The temporary fix with our native API gateway until we move to fully native xDS generation is to munge the compiled discovery chain that we synthesize for the API gateway and filter out both the router's default route and the resolver node for the router.
Testing & Reproduction steps
Running this script shows these timings.
Before the fix:
And after:
PR Checklist
Overview of commits