-
Notifications
You must be signed in to change notification settings - Fork 871
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
Fix queue rate limiting busy loop #3111
Conversation
@@ -414,12 +414,14 @@ func newQueueProcessorRateLimiter( | |||
) quotas.RateLimiter { | |||
return quotas.NewMultiRateLimiter( | |||
[]quotas.RateLimiter{ | |||
// consume from host rate limiter as it's usually the one throttles the traffic | |||
// and avoid unnecessary consume and cancel on shard level rate limiter | |||
hostRateLimiter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will one rogue shard exhaust all host quota?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is if later ratelimiter (the shard level one) can't pass, previous reservations will be cancelled.
https://github.com/temporalio/temporal/blob/master/common/quotas/multi_rate_limiter_impl.go#L106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test to verify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My local test shows it works fine. But theoretically one rogue shard can still affect others since other shard can try to get a host token before the rouge shard cancels it. So I reverted the change here to be safe.
The busy loop issue is still fixed.
@@ -414,12 +414,14 @@ func newQueueProcessorRateLimiter( | |||
) quotas.RateLimiter { | |||
return quotas.NewMultiRateLimiter( | |||
[]quotas.RateLimiter{ | |||
// consume from host rate limiter as it's usually the one throttles the traffic | |||
// and avoid unnecessary consume and cancel on shard level rate limiter | |||
hostRateLimiter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test to verify.
What changed?
Why?
How did you test it?
Potential risks
Is hotfix candidate?