temporalio / temporalio/temporal
Per task queue ratelimiting should only count valid activity tasks
@maoyi16 is already working on this.
Since Jul 27, 2022.
- Dominant language
- Go
- Stars
- 23.2k
- Forks
- 1.9k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 228
Description
Expected Behavior
Only valid (started) tasks should count towards per task queue ratelimiting. (when user specifies TaskQueueActivitiesPerSecond in worker config)
Actual Behavior
https://github.com/temporalio/temporal/blob/master/service/matching/matcher.go#L228
All tasks, regardless of whether its expired or failed to start or successfully started will consume token from the rate limiter, since we perform the rate limiting step when attempting a match.
For example when there's a backlog of expired tasks in the task buffer, all tasks will consume the rate limiting token and throttle how fast the backlog can be drained. However, from user/worker perspective, there's no dispatched tasks at all.
Steps to Reproduce the Problem
Specifications
- Version:
- Platform:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.