Skip to content

Feature: gateway timeouts #78

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

Merged

Conversation

superbeeny
Copy link
Contributor

New design note for gateway timeouts

@superbeeny superbeeny requested review from a team as code owners January 27, 2025 18:40
Signed-off-by: Nick Beenham <[email protected]>
@superbeeny superbeeny changed the title new design note for gateway timeouts Feature: gateway timeouts Jan 27, 2025
**idle:** The amount of time the gateway should wait for a response from the application before timing out when the connection is idle.
**idleConnection:** The amount of time the gateway should wait for a response from the application before timing out when the connection is idle.

This maps to the contour timeoutPolicy - https://github.com/projectcontour/contour/blob/main/apis/projectcontour/v1/httpproxy.go#L1126
Copy link
Contributor

@kachawla kachawla Feb 4, 2025

Choose a reason for hiding this comment

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

Do we need to consider how this design will evolve if we support other ingress controllers options in future?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 as removing Contour as a hard dependency is on the roadmap: radius-project/roadmap#58

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will need refactoring, will check with k8s gateway API for similarities

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I looked into this and adapted to follow the k8s gateway api spec

The solution would update the specification for the gateway resource in the bicep file to include a timeoutPolicy object. This object would contain the following properties:
**response:** The amount of time the gateway should wait for a response from the application before timing out.
**idle:** The amount of time the gateway should wait for a response from the application before timing out when the connection is idle.
**idleConnection:** The amount of time the gateway should wait for a response from the application before timing out when the connection is idle.
Copy link
Contributor

Choose a reason for hiding this comment

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

idle and idleConnection seem to have same meaning, should we clarify it better when we write the user docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update

@smatochkin
Copy link

Any thoughts on the future maintenance of the spec with the possible gateway implementation changes? The suggested contract change is tied to Contour specific implementation of the gateway. If there is a plan to switch from Contour specific API to more generic GatewayAPI, then the suggested contact will be hard to migrate.

Copy link
Member

@brooke-hamilton brooke-hamilton left a comment

Choose a reason for hiding this comment

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

🚀 This is good - agree with checking on the K8s gateway api, as well.

@superbeeny
Copy link
Contributor Author

Adding a new comment for timeouts comparison with the gateway api specification. Route Timeouts have 2 optional fields:

request defined as

Request specifies the maximum duration for a gateway to respond to an HTTP request. If the gateway has not been able to respond before this deadline is met, the gateway MUST return a timeout error.

and backendRequest defined as

BackendRequest specifies a timeout for an individual request from the gateway to a backend. This covers the time from when the request first starts being sent from the gateway to when the full response has been received from the backend.

Is the consensus to update to match the gateway specification?

Copy link

This pull request is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 20, 2025
@superbeeny
Copy link
Contributor Author

Can I get a review please @kachawla , @zachcasper @sylvainsf

Signed-off-by: Nick Beenham <[email protected]>
@github-actions github-actions bot removed the Stale label Feb 21, 2025
willdavsmith
willdavsmith previously approved these changes Mar 11, 2025
Copy link
Contributor

@willdavsmith willdavsmith left a comment

Choose a reason for hiding this comment

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

LGTM, great doc!

@superbeeny
Copy link
Contributor Author

@willtsai is anything else needed here to approve and merge?

Copy link
Contributor

Choose a reason for hiding this comment

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

In this scenario deployment to Kubernetes is handled by Application RP instead of DE.

@kachawla
Copy link
Contributor

Thanks for the updates @superbeeny. Did you also get a chance to look into #78 (comment)?

@kachawla
Copy link
Contributor

Request specifies the maximum duration for a gateway to respond to an HTTP request. If the gateway has not been able to respond before this deadline is met, the gateway MUST return a timeout err

Just saw your comment above on this #78 (comment). It makes sense to me, thanks for looking into this. Some of the places in the doc need to be updated to reflect this.

@superbeeny
Copy link
Contributor Author

Left another comment on #78

@kachawla
Copy link
Contributor

Left another comment on #78

Thanks @superbeeny! Let me know when the PR is ready for re-review. This is close to approval :)

@superbeeny
Copy link
Contributor Author

@kachawla I think this is ready now, let's have a run through it if not

@kachawla
Copy link
Contributor

@kachawla I think this is ready now, let's have a run through it if not

@superbeeny, doesn't look like your updates are reflected in the PR. Could you please look into the comments above from 2 weeks ago?

Signed-off-by: Nick Beenham <[email protected]>
@superbeeny
Copy link
Contributor Author

@kachawla I think this is ready now, let's have a run through it if not

@superbeeny, doesn't look like your updates are reflected in the PR. Could you please look into the comments above from 2 weeks ago?

addressed comments and ready for review

kachawla
kachawla previously approved these changes Apr 25, 2025
@kachawla kachawla merged commit 046bfbf into radius-project:main Apr 25, 2025
2 checks passed
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.

8 participants