Skip to content

API: support max_retries in circuit breakers API#2773

Merged
zhaohuabing merged 5 commits intoenvoyproxy:mainfrom
guydc:api-impl-max-retries
Mar 5, 2024
Merged

API: support max_retries in circuit breakers API#2773
zhaohuabing merged 5 commits intoenvoyproxy:mainfrom
guydc:api-impl-max-retries

Conversation

@guydc
Copy link
Copy Markdown
Contributor

@guydc guydc commented Mar 4, 2024

What this PR does / why we need it:
Allows configuration of max_retries in BTP's circuit breakers. After some internal discussion, it seems that circuit breakers are a better location for this feature:

  • Retry settings are per route and refer to per-request behavior
  • Max retries setting are per-backend-per-route, similar to other circuit breakers
  • Max retries settings are limiting a certain type of upstream requests, similar to other circuit breakers

We should enhance documentation and let users know that these retry-related settings exist in the circuit breakers section.

Removes retry_budget for now, following the discussion here: #2769 (comment)

Which issue(s) this PR fixes:
Fixes #2322

…ults

Signed-off-by: Guy Daich <guy.daich@sap.com>
@guydc guydc requested a review from a team as a code owner March 4, 2024 20:40
guydc added 2 commits March 4, 2024 14:41
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 73.68421% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 63.43%. Comparing base (ce1eb54) to head (b11a8a5).

Files Patch % Lines
internal/ir/zz_generated.deepcopy.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2773      +/-   ##
==========================================
- Coverage   63.44%   63.43%   -0.02%     
==========================================
  Files         125      125              
  Lines       20532    20547      +15     
==========================================
+ Hits        13027    13033       +6     
- Misses       6668     6676       +8     
- Partials      837      838       +1     

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

Signed-off-by: Guy Daich <guy.daich@sap.com>
@arkodg arkodg added this to the v1.0.0-rc1 milestone Mar 4, 2024
if circuitBreaker.MaxParallelRetries != nil {
cbt.MaxRetries = &wrapperspb.UInt32Value{
Value: *circuitBreaker.MaxParallelRetries,
}
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.

lets be explicit with 1024 in case circuitBreaker.MaxParallelRetries == nil, in case we decide to run in non k8s env that doesnt set that default

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.

maybe we even need to set it if circuitBreaker == nil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do. For the other settings, I think that there's no reason to do it, as they anyway default to 1024 on envoy level.

Signed-off-by: Guy Daich <guy.daich@sap.com>
Copy link
Copy Markdown
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks !

@arkodg arkodg requested review from a team March 4, 2024 21:21
@guydc guydc mentioned this pull request Mar 5, 2024
Copy link
Copy Markdown
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@zhaohuabing zhaohuabing merged commit dd60e40 into envoyproxy:main Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

Find the right home for maximum number of parallel retries

3 participants