Skip to content

router: add dynamic max_stream_duration for upstream - #15433

Merged
snowp merged 23 commits into
envoyproxy:mainfrom
Shikugawa:fix-14260
Sep 3, 2021
Merged

snowp merged 23 commits into
envoyproxy:mainfrom
Shikugawa:fix-14260

Conversation

@Shikugawa

@Shikugawa Shikugawa commented Mar 11, 2021 •

Copy link
Copy Markdown
Member

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Commit Message: Close #14260. It adds dynamic max_stream_duration to configure for upstream request. It works with setting x-envoy-upstream-stream-timeout-ms and is prior to set toward static upstream max_stream_duration.
Additional Description:
Risk Level: Low
Testing: Unit / Integration
Docs Changes: Required
Release Notes: Required
Fixes #14260

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot added the stale stalebot believes this issue/PR has not been touched recently label Apr 15, 2021
@Shikugawa Shikugawa removed the stale stalebot believes this issue/PR has not been touched recently label Apr 16, 2021
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot added the stale stalebot believes this issue/PR has not been touched recently label May 16, 2021
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot closed this May 23, 2021
@Shikugawa Shikugawa reopened this Jul 13, 2021
Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
@Shikugawa Shikugawa removed the stale stalebot believes this issue/PR has not been touched recently label Jul 14, 2021
Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
@Shikugawa
Shikugawa requested a review from alyssawilk July 14, 2021 17:03
@Shikugawa

Copy link
Copy Markdown
Member Author

@alyssawilk Could you take a look?

@alyssawilk

Copy link
Copy Markdown
Contributor

mind checking out CI first - looks like there's a tidy failure?
/wait

Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
@alyssawilk

Copy link
Copy Markdown
Contributor

looks like clang tidy may need a look (and unsure if coverage is a flake or not but I'll let you check)
/wait

alyssawilk
alyssawilk previously approved these changes Aug 5, 2021

@alyssawilk alyssawilk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM modulo one tiny nit.
@snowp would you be willing to do a pass as well?

@snowp snowp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! A few comments, overall this makes sense to me

Comment thread docs/root/version_history/current.rst Resolved
Comment thread source/common/router/router.cc Resolved
Comment thread source/common/router/router.cc Resolved
Comment thread test/common/router/router_test.cc Resolved
@snowp snowp added the waiting label Aug 9, 2021
Signed-off-by: Shikugawa <[email protected]>

@snowp snowp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, just a few more nits and then I think we're good to go

Comment thread source/common/router/router.h Resolved
Signed-off-by: Shikugawa <[email protected]>

@snowp snowp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, deferring to @alyssawilk for final merge

@alyssawilk

Copy link
Copy Markdown
Contributor

looks good modulo the coverage failure. I'll try a re-run but it may need a main merge
/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15433 (comment) was created by @alyssawilk.

see: more, trace.

@alyssawilk

Copy link
Copy Markdown
Contributor

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15433 (comment) was created by @alyssawilk.

see: more, trace.

@Shikugawa

Copy link
Copy Markdown
Member Author

@alyssawilk Could we merge?

@snowp
snowp merged commit d7e1f92 into envoyproxy:main Sep 3, 2021
@Shikugawa
Shikugawa deleted the fix-14260 branch September 4, 2021 00:49
ggreenway pushed a commit that referenced this pull request Oct 7, 2026
…ests (#48067)

The router honours the `x-envoy-upstream-stream-duration-ms` request
header from any client.
`ConnectionManagerUtility::cleanInternalHeaders()` removes the other
router timeout and retry control headers
(`x-envoy-upstream-rq-timeout-ms`, `x-envoy-max-retries`,
`x-envoy-retry-on`, ...) from external requests, but this one was missed
when it was added in #15433. As a result, any external client can set a
per-request upstream stream duration and make Envoy abort the upstream
request with a local reply.

This PR removes the header from external requests alongside the others.
The change is guarded by
`envoy.reloadable_features.sanitize_upstream_stream_duration_header`
(default `true`) for deployments that send the header from clients Envoy
classifies as external.

It also adds the header to the header sanitizing docs, documents that it
is only honoured for internal clients, and corrects the documented
response code: the local reply is a 504, or a 408 if the downstream
request has not been fully received
(`Http::Utility::maybeRequestTimeoutCode()`), not always a 408.

Fixes #48066

Runtime guard:
`envoy.reloadable_features.sanitize_upstream_stream_duration_header`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Lee Boynton <[email protected]>
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.

Update max_stream_duration dynamically

4 participants