Skip to content

api: add more timeout fields to ClientTimeout - #9315

Open
HusseinKabbout wants to merge 16 commits into
envoyproxy:mainfrom
HusseinKabbout:support-more-timeouts
Open

api: add more timeout fields to ClientTimeout#9315
HusseinKabbout wants to merge 16 commits into
envoyproxy:mainfrom
HusseinKabbout:support-more-timeouts

Conversation

@HusseinKabbout

@HusseinKabbout HusseinKabbout commented Jun 23, 2026

Copy link
Copy Markdown

What type of PR is this?
Feature + API (non-breaking)

What this PR does / why we need it:

This PR exposes new Envoy proxy timeout settings in ClientTrafficPolicy when dealing with untrusted downstreams. By tweaking these new exposed settings, DoS protection can be improved depending on the use case.

The settings are:

Which issue(s) this PR fixes:

Fixes #9254

PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: If this PR contains API changes (changes under /api), the API was discussed and agreed before the implementation. The API change can be in a separate PR, or in the same PR, but the API must be agreed before implementation. N/A if this PR does not contain API changes.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.
  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR. N/A if this PR does not contain user-facing changes.
  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes.
  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

Signed-off-by: kabbohus <hussein.kabbout@united-security-providers.ch>
@HusseinKabbout
HusseinKabbout requested a review from a team as a code owner June 23, 2026 13:04
@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit ab16855
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a7089da74bbba000806f5b8
😎 Deploy Preview https://deploy-preview-9315--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@HusseinKabbout

Copy link
Copy Markdown
Author

As instructed, I have created a PR to propose the new API changes before implementing anything.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7417ab4412

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread api/v1alpha1/timeout_types.go Outdated
Comment thread api/v1alpha1/timeout_types.go Outdated
@jukie

jukie commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@HusseinKabbout can you run make generate and make gen-check to confirm, then commit the result?

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.14815% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.03%. Comparing base (4898608) to head (c4a8a31).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/xds/translator/listener.go 20.00% 4 Missing and 4 partials ⚠️
internal/gatewayapi/clienttrafficpolicy.go 60.00% 3 Missing and 3 partials ⚠️

❌ Your patch check has failed because the patch coverage (48.14%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9315      +/-   ##
==========================================
- Coverage   76.05%   76.03%   -0.02%     
==========================================
  Files         260      260              
  Lines       43367    43392      +25     
==========================================
+ Hits        32984    32995      +11     
- Misses       8184     8191       +7     
- Partials     2199     2206       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: kabbohus <hussein.kabbout@united-security-providers.ch>
@HusseinKabbout

Copy link
Copy Markdown
Author

@HusseinKabbout can you run make generate and make gen-check to confirm, then commit the result?

Sure thing!

@arkodg arkodg added this to the v1.9.0-rc.1 Release milestone Jul 20, 2026
Comment thread api/v1alpha1/timeout_types.go Outdated
kabbohus added 2 commits July 20, 2026 08:30
Signed-off-by: kabbohus <hussein.kabbout@united-security-providers.ch>
@HusseinKabbout
HusseinKabbout force-pushed the support-more-timeouts branch from 4141323 to 96aec06 Compare July 20, 2026 07:10
Comment thread api/v1alpha1/timeout_types.go Outdated
Comment thread api/v1alpha1/timeout_types.go Outdated
kabbohus added 2 commits July 27, 2026 09:19
Signed-off-by: kabbohus <hussein.kabbout@united-security-providers.ch>
@HusseinKabbout
HusseinKabbout force-pushed the support-more-timeouts branch from b169c44 to 041b9b9 Compare July 27, 2026 07:25
kabbohus added 3 commits July 30, 2026 12:19
Signed-off-by: kabbohus <hussein.kabbout@united-security-providers.ch>
Signed-off-by: kabbohus <hussein.kabbout@united-security-providers.ch>
Signed-off-by: kabbohus <hussein.kabbout@united-security-providers.ch>
@HusseinKabbout
HusseinKabbout force-pushed the support-more-timeouts branch from 4805145 to f8799b4 Compare July 30, 2026 10:20
@HusseinKabbout

Copy link
Copy Markdown
Author

Based on the discussion, I think the API looks OK now. I can still rename the attributes but I think their place in the API is settled.

I went ahead and implemented the timouts. One open question I have is how does EG handle defaults? Should I explicitly set default values when they make sense (they do here)?

Signed-off-by: kabbohus <hussein.kabbout@united-security-providers.ch>
@HusseinKabbout

Copy link
Copy Markdown
Author

Regarding e2e tests, I did not find any EG timeout tests, only a conformance test related to Gateway API timeouts.

@HusseinKabbout

HusseinKabbout commented Jul 31, 2026

Copy link
Copy Markdown
Author

@arkodg Do you think this can get in v1.9.0-rc.1 Release or is it maybe too late?

@zhaohuabing

Copy link
Copy Markdown
Member

@arkodg Do you think this can get in v1.9.0-rc.1 Release or is it maybe too late?

Hi @HusseinKabbout could you please rename HandshakeTimeout to TLSHandshakeTimeout? We may still be able to land this in v1.9.0.

kabbohus and others added 2 commits August 3, 2026 09:42
Signed-off-by: kabbohus <hussein.kabbout@united-security-providers.ch>
Comment thread internal/ir/xds.go Outdated
@zhaohuabing

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4a8a31eee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +253 to +254
if timeout != nil && timeout.TCP != nil && timeout.TCP.ConnectionInspectionTimeout != nil {
listener.ListenerFiltersTimeout = durationpb.New(timeout.TCP.ConnectionInspectionTimeout.Duration)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Apply inspection timeouts to reused listeners

When multiple HTTPS or TLS listeners share an address and port, only the first IR listener creates the xDS listener; subsequent listeners reuse it without revisiting ListenerFiltersTimeout. Consequently, a ClientTrafficPolicy targeting a later listener has its connectionInspectionTimeout silently ignored, while a timeout on the first listener affects every filter chain on that socket. The existing overlap validation only covers non-HTTPS listeners, so this global setting must either be reconciled across shared listeners or conflicting policies must be rejected.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not sure this makes sense. ClientTrafficPolicy is per listener and EG tracks which listeners have already been attached to and errors out for that policy.

When multiple HTTPS or TLS listeners share an address and port, only the first IR listener creates the xDS listener

Since they share the same xDS listener then we can't actually have a different ListenerFiltersTimeout anyway, right? Am I missing something here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You're right that we can't have different values per listener — listener_filters_timeout is a Listener field, not a FilterChain field, so "reconciling" isn't an option.

The conflict is still real though, just framed differently. The tracking you mention is one-CTP-per-section, and the port-overlap check skips TLS listeners (it assumes each gets its own filter chain, which is true for filter-chain-scoped settings but not listener-scoped ones). So with two HTTPS listeners on :443 and a CTP per section, both are Accepted, the first-processed value wins for both, and the other is silently dropped.

That said, this isn't introduced by your PR — the same applies to connection.bufferLimit, tcpKeepalive, and proxy protocol (see the existing TODO in translator.go). A proper fix is a cross-listener consistency check covering all of them, which belongs in its own PR.

Non-blocking. Just worth a sentence in the ConnectionInspectionTimeout godoc that it applies to the whole listener socket, so users aren't surprised when a shared address:port picks one value. A follow-up issue would be nice too.

HusseinKabbout and others added 2 commits August 3, 2026 13:56
Co-authored-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: kabbohus <hussein.kabbout@hotmail.com>
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.

Support more timeout settings

4 participants