Attach RateLimiter using UpdateTaskQueueConfig api configration#8058
Attach RateLimiter using UpdateTaskQueueConfig api configration#8058sivagirish81 merged 25 commits intotemporalio:mainfrom
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
tests/task_queue_test.go
Outdated
|
|
||
| workflowFn := func(ctx workflow.Context) error { | ||
| ao := workflow.ActivityOptions{ | ||
| TaskQueue: activityTaskQueue, // Route activities to a dedicated task queue named `activityTaskQueue` |
There was a problem hiding this comment.
Maybe reword the comment to mention why you're doing this instead.
tests/task_queue_test.go
Outdated
| func (s *TaskQueueSuite) runTestTaskQueueAPIRateLimitOverridesWorkerLimit(apiRPS float32, taskCount int, minGap time.Duration, maxGap time.Duration, activityTaskQueue string) { | ||
| // Set the burst as 1 to make sure not more than 1 task get's acknowledged at a time. | ||
| // Helps observe the backlog drain more easily. | ||
| s.OverrideDynamicConfig(dynamicconfig.MatchingMinTaskThrottlingBurstSize, 1) |
There was a problem hiding this comment.
Can you set it to 0 to avoid the special case at the bottom of the test?
There was a problem hiding this comment.
Burst is overriden regardless of the value we set here at time of ratelimitupdate.
minTaskThrottlingBurstSize := r.config.MinTaskThrottlingBurstSize()
if burst < minTaskThrottlingBurstSize {
burst = minTaskThrottlingBurstSize
}
So we will need to enforce the special case at the bottom of the test - ignore the gap between the first and the second task and check for the gap between the remaining tasks.
Fixed unit test and naming convention for locked functions.
dnr
left a comment
There was a problem hiding this comment.
alright, a few small comments. the partition count stuff could be handled in the next pr. what do you think about the others?
tests/task_queue_test.go
Outdated
|
|
||
| // Start the activity worker | ||
| activityWorker := worker.New(s.SdkClient(), activityTaskQueue, worker.Options{ | ||
| // Setting rate limit at worker level |
There was a problem hiding this comment.
| // Setting rate limit at worker level | |
| // Setting rate limit at worker level (this will be ignored in favor of the limit set through the api) |
tests/task_queue_test.go
Outdated
| defer wfWorker.Stop() | ||
|
|
||
| // Launch workflows | ||
| for i := 0; i < taskCount; i++ { |
There was a problem hiding this comment.
| for i := 0; i < taskCount; i++ { | |
| for i := range taskCount { |
What changed?
Why?
How did you test it?
Potential risks
N/A