-
Notifications
You must be signed in to change notification settings - Fork 917
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
Add explicit per-namespace rate limit to schedules #3838
Conversation
service/worker/scheduler/fx.go
Outdated
func (s *workerComponent) activities(name namespace.Name, id namespace.ID) *activities { | ||
func (s *workerComponent) activities(name namespace.Name, id namespace.ID, workerFactor float64) *activities { | ||
localRPS := func() float64 { | ||
return s.globalNSStartWorkflowRPS(name.String()) * workerFactor |
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.
Can we not introduce this workerFactor? I think it might be more clear here to calculate it as:
localRPS = multiplicity * (globalRPS / totalWorkerCount).
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.
So you want to pass in multiplicity and total and do the division inside here? I guess that's fine too
} | ||
for { | ||
var res schedspb.StartWorkflowResponse | ||
err := workflow.ExecuteLocalActivity(ctx, s.a.StartWorkflow, req).Get(s.ctx, &res) |
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.
if this keep happening, will this blow up the history size?
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.
It happens at most once, that's what CompletedRateLimitSleep is for
What changed?
Add explicit per-namespace rate limit to schedule start workflow actions.
Why?
Server operators might like to be able to limit the number of workflows started by schedules, to avoid overloading the rest of the cluster if the feature is misused.
How did you test it?
New integration test
Potential risks
Is hotfix candidate?