Skip to content
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

Explicitly set a rate limiter for controller config #416

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

thunderboltsid
Copy link
Contributor

@thunderboltsid thunderboltsid commented Apr 23, 2024

The rate limiter is a MaxOfRateLimiter similar to the default one. However, now the base delay, max delay, bucket size, and qps can be configured using flags. The default values are 500ms for base delay and 15min for max delay in the exponential backoff limiter (custom values) and 10 qps and 100 bucket size for the bucket limiter (same as the default one).

@thunderboltsid
Copy link
Contributor Author

/retest

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

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

Project coverage is 26.91%. Comparing base (03c61d3) to head (394d9cb).

Files Patch % Lines
main.go 93.10% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #416      +/-   ##
==========================================
+ Coverage   25.18%   26.91%   +1.72%     
==========================================
  Files          19       19              
  Lines        1326     1360      +34     
==========================================
+ Hits          334      366      +32     
- Misses        992      994       +2     

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

@thunderboltsid thunderboltsid requested review from dkoshkin and deepakm-ntnx and removed request for tuxtof April 23, 2024 20:01
@thunderboltsid thunderboltsid changed the title Explicitly set a exponential backoff rate limiter for controller config Explicitly set a rate limiter for controller config Apr 23, 2024
@deepakm-ntnx
Copy link
Contributor

just documenting here for completeness. https://stuartleeks.com/posts/error-back-off-with-controller-runtime/

@thunderboltsid
Copy link
Contributor Author

thunderboltsid commented Apr 23, 2024

just documenting here for completeness. https://stuartleeks.com/posts/error-back-off-with-controller-runtime/

This article is slightly outdated. Newer versions of the controller-runtime directly use workqueue.DefaultControllerRateLimiter provided by client-go library by default instead without any manually set MakeQueue object.

dkoshkin
dkoshkin previously approved these changes Apr 23, 2024
main.go Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@thunderboltsid
Copy link
Contributor Author

/retest

Copy link
Contributor

@adiantum adiantum left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@nutanix-cn-prow-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adiantum, dkoshkin, thunderboltsid

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [adiantum,thunderboltsid]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@thunderboltsid
Copy link
Contributor Author

/retest

main.go Show resolved Hide resolved
@deepakm-ntnx
Copy link
Contributor

pls create a tracker to test the behavior in general either manual or automated

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
@thunderboltsid
Copy link
Contributor Author

/retest

1 similar comment
@thunderboltsid
Copy link
Contributor Author

/retest

@thunderboltsid thunderboltsid merged commit 714c151 into main Apr 25, 2024
12 of 13 checks passed
@thunderboltsid thunderboltsid deleted the jira/krbn-8105 branch April 25, 2024 02:05
thunderboltsid added a commit that referenced this pull request Apr 29, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request Apr 29, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request Apr 29, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request Apr 29, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request May 2, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request May 2, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request May 2, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request May 2, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request May 2, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request May 2, 2024
…ig (#416) (#423)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request May 10, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request May 14, 2024
…ig (#416)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
thunderboltsid added a commit that referenced this pull request May 14, 2024
…ig (#416) (#432)

The rate limiter base delay and max delay values can be configured using
flags. The default values are 500ms for base delay and 15min for max delay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants