Skip to content

http/ratelimit,http/ext_authz: change timeout=0 behavior#43020

Merged
mattklein123 merged 3 commits intoenvoyproxy:mainfrom
wdauchy:timeout
Jan 25, 2026
Merged

http/ratelimit,http/ext_authz: change timeout=0 behavior#43020
mattklein123 merged 3 commits intoenvoyproxy:mainfrom
wdauchy:timeout

Conversation

@wdauchy
Copy link
Copy Markdown
Contributor

@wdauchy wdauchy commented Jan 15, 2026

Commit Message:
When configuring timeout: 0s in the HTTP rate limit or ext_authz filters, requests would fail immediately instead of having no timeout (infinite).

This happened because timeout: 0s was converted to std::chrono::milliseconds(0) and passed to the gRPC client. In the gRPC client layer:

  • Google gRPC: deadline = now + 0ms = now (immediate timeout)
  • Envoy gRPC: sets grpc-timeout: 0m header (interpreted as immediate timeout)

This behavior is inconsistent with other Envoy timeout configurations (e.g., RouteAction.timeout) where 0 explicitly means "disabled/infinite".

Also the doc is actually unclear about it (before the patch).

Convert timeout: 0s to absl::nullopt (no timeout) instead of std::chrono::milliseconds(0). This makes the behavior consistent:

  • timeout not set: use default (20ms for ratelimit, 200ms for ext_authz)
  • timeout: 0s: infinite (no timeout)
  • timeout: >0: actual timeout value

we could possibly change that behavior with a flag to revert.

Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #43020 was opened by wdauchy.

see: more, trace.

@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #43020 was opened by wdauchy.

see: more, trace.

When configuring timeout: 0s in the HTTP rate limit or ext_authz filters,
requests would fail immediately instead of having no timeout (infinite).

This happened because timeout: 0s was converted to std::chrono::milliseconds(0)
and passed to the gRPC client. In the gRPC client layer:
- Google gRPC: deadline = now + 0ms = now (immediate timeout)
- Envoy gRPC: sets grpc-timeout: 0m header (interpreted as immediate timeout)

This behavior is inconsistent with other Envoy timeout configurations
(e.g., RouteAction.timeout) where 0 explicitly means "disabled/infinite".

Also the doc is actually unclear about it (before the patch).

Convert timeout: 0s to absl::nullopt (no timeout) instead of
std::chrono::milliseconds(0). This makes the behavior consistent:
- timeout not set: use default (20ms for ratelimit, 200ms for ext_authz)
- timeout: 0s: infinite (no timeout)
- timeout: >0: actual timeout value

we could possibly change that behavior with a flag to revert.

Signed-off-by: William Dauchy <william.dauchy@datadoghq.com>
@wdauchy wdauchy marked this pull request as ready for review January 16, 2026 11:16
Copy link
Copy Markdown
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

/lgtm api
Assigning code-owners.
/assign @esmet @mattklein123


// The timeout in milliseconds for the rate limit service RPC. If not
// set, this defaults to 20ms.
// set, this defaults to 20ms. A value of 0 disables the timeout (infinite).
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.

I guess that in this case the request/connection timeouts will be used (so it may not be infinite).
Not sure if it's worth pointing out or not, and I'll leave it to the rate-limit owners to decide.

@adisuissa
Copy link
Copy Markdown
Contributor

/assign @esmet @mattklein123

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Needs a release note, thanks.

/wait

# Conflicts:
#	test/extensions/filters/http/ext_authz/ext_authz_test.cc
Signed-off-by: William Dauchy <william.dauchy@datadoghq.com>
@wdauchy
Copy link
Copy Markdown
Contributor Author

wdauchy commented Jan 24, 2026

Needs a release note, thanks.

now fixed

@wdauchy wdauchy requested a review from mattklein123 January 24, 2026 11:50
@mattklein123 mattklein123 merged commit cbe23a8 into envoyproxy:main Jan 25, 2026
26 checks passed
shane-yuan pushed a commit to shane-yuan/envoy that referenced this pull request Feb 11, 2026
…43020)

Commit Message:
When configuring timeout: 0s in the HTTP rate limit or ext_authz
filters, requests would fail immediately instead of having no timeout
(infinite).

This happened because timeout: 0s was converted to
std::chrono::milliseconds(0) and passed to the gRPC client. In the gRPC
client layer:
- Google gRPC: deadline = now + 0ms = now (immediate timeout)
- Envoy gRPC: sets grpc-timeout: 0m header (interpreted as immediate
timeout)

This behavior is inconsistent with other Envoy timeout configurations
(e.g., RouteAction.timeout) where 0 explicitly means
"disabled/infinite".

Also the doc is actually unclear about it (before the patch).

Convert timeout: 0s to absl::nullopt (no timeout) instead of
std::chrono::milliseconds(0). This makes the behavior consistent:
- timeout not set: use default (20ms for ratelimit, 200ms for ext_authz)
- timeout: 0s: infinite (no timeout)
- timeout: >0: actual timeout value

we could possibly change that behavior with a flag to revert.

Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: William Dauchy <william.dauchy@datadoghq.com>
grnmeira pushed a commit to grnmeira/envoy that referenced this pull request Mar 20, 2026
…43020)

Commit Message:
When configuring timeout: 0s in the HTTP rate limit or ext_authz
filters, requests would fail immediately instead of having no timeout
(infinite).

This happened because timeout: 0s was converted to
std::chrono::milliseconds(0) and passed to the gRPC client. In the gRPC
client layer:
- Google gRPC: deadline = now + 0ms = now (immediate timeout)
- Envoy gRPC: sets grpc-timeout: 0m header (interpreted as immediate
timeout)

This behavior is inconsistent with other Envoy timeout configurations
(e.g., RouteAction.timeout) where 0 explicitly means
"disabled/infinite".

Also the doc is actually unclear about it (before the patch).

Convert timeout: 0s to absl::nullopt (no timeout) instead of
std::chrono::milliseconds(0). This makes the behavior consistent:
- timeout not set: use default (20ms for ratelimit, 200ms for ext_authz)
- timeout: 0s: infinite (no timeout)
- timeout: >0: actual timeout value

we could possibly change that behavior with a flag to revert.

Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: William Dauchy <william.dauchy@datadoghq.com>
Signed-off-by: Gustavo <grnmeira@gmail.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.

4 participants