temporalio / temporalio/temporal

Per task queue ratelimiting should only count valid activity tasks

Open
#3,145 0 comments 0 reactions 1 assignee View on GitHub

@maoyi16 is already working on this.

Since Jul 27, 2022.

potential-bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.