Skip to content
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

feat: expose HTTP timeout on AIServiceBackend #384

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

daixiang0
Copy link
Member

@daixiang0 daixiang0 commented Feb 20, 2025

Commit Message

This adds timeouts field on AIServiceBackend to allow the configuration of timeouts per backend.

Related Issues/PRs (if applicable)

Fixes #361

@daixiang0 daixiang0 requested a review from a team as a code owner February 20, 2025 07:35
@daixiang0
Copy link
Member Author

daixiang0 commented Feb 20, 2025

I will add tests if basic logic is OK.

@yuzisun please take a look.

Signed-off-by: Loong <[email protected]>
@daixiang0 daixiang0 changed the title controller: Expose HTTP timeout to AIGatewayRoute controller: expose HTTP timeout to AIGatewayRoute Feb 21, 2025
Signed-off-by: Loong <[email protected]>
Signed-off-by: Loong <[email protected]>
@@ -675,3 +680,14 @@ func backendSecurityPolicyVolumeName(ruleIndex, backendRefIndex int, name string
func backendSecurityMountPath(backendSecurityPolicyKey string) string {
return fmt.Sprintf("%s/%s", mountedExtProcSecretPath, backendSecurityPolicyKey)
}

func defaultTimeout() *gwapiv1.HTTPRouteTimeouts {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not find a good timing to set default value, put here for discussion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default timeout for the default route, for the other routes it is still going to default to 15s which is the envoy default timeout if not specified.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathetake Do we really need this default route?

Copy link
Member

@mathetake mathetake Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the / is unfortunately necessary as without it, any request will result in 404; envoy router executes before extproc once at the very first phase of request handling, and 404 will be returned before it reaches extproc. However, in reality it should never be used since if the extproc router doesn’t find any match, extproc will return 404 immediate response, not routing to default backend.
so to deal with it in the PR, i don’t think we need to do anything- just leave it as default without setting

my comment from slack; tldr is the default route is an implementation detail that shouldn't be used or have any impact on the behavior users expect. So i would suggest to just remove this defaultTimeout and leave it nil and make it default to the envoy default

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove defaultTimeout and I think we are good to go

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

@mathetake mathetake changed the title controller: expose HTTP timeout to AIGatewayRoute feat: expose HTTP timeout to AIGatewayRoute Feb 25, 2025
@mathetake mathetake changed the title feat: expose HTTP timeout to AIGatewayRoute feat: expose HTTP timeout on AIServiceBackend Feb 25, 2025
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.

Expose HTTP timeout to AIGatewayRoute
3 participants