-
Notifications
You must be signed in to change notification settings - Fork 123
Add fallback logic to support multiple endpoints #1122
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rlakhtakia The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @rlakhtakia. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
mostly already implemented in #1059 |
I think there is still some work to be done to actually return multiple endpoints, can we please rebase and address what is left? |
/ok-to-test |
@rlakhtakia: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@ahg-g @nirrozenbaum updated conflicts to remove duplicated logic from #1059 The main change incorporated now is to add the multiple endpoints to the header response. |
/ok-to-test |
pkg/epp/requestcontrol/director.go
Outdated
|
||
endpoint := net.JoinHostPort(targetPod.Address, strconv.Itoa(targetPort)) | ||
logger.V(logutil.DEFAULT).Info("Request handled", "model", reqCtx.Model, "targetModel", reqCtx.ResolvedTargetModel, "endpoint", targetPod) | ||
combinedEndpointsString := strings.Join(targetEndpoints, ",") | ||
|
||
reqCtx.TargetPod = targetPod |
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.
This is a bit problematic.
reqCtx.TargetPod is used later to call PostResponse plugins and we should call the plugins with the pod that served the request (the first pod did not necessarily serve it, if the request failed and used fallback to next endpoint).
up until today we used a single endpoint, so that assumption was safe (either the request succeeded and then this is the pod, or it failed). but this assumption is no longer true and reqCtx.TargetPod should be updated correctly to reflect the pod that served the request.
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.
I added some functionality to have multiple target pods. If we don't want to disrupt the current flow, I can add an extra field labelled 'FallbackPods' which will be the remaining list of pods
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.
last change is making changes to the scheduler interfaces.. that wasn't the intention :)
the interfaces shouldn't change (I'm referring to PostResponse interface).
in the last change the problem just moved from the director to PostResponse. in PostResponse we need to know which pod actually SERVED the request. there is only one such pod.
not the first one out of the candidate list (cause the first one didn't necessarily served the request, this is the whole point of supporting multiple endpoints).
/retest |
#414