Skip to content
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

Rate limit task processing requests guarded by feature flag #5804

Merged
merged 4 commits into from
Mar 22, 2024

Conversation

sankari165
Copy link
Contributor

What changed?
Task processing requests will be rate limited if enabled by domain level feature flag

Why?
Introducing wf-id based rate limits for task processing

How did you test it?
Unit tests

Potential risks
None for now since the rate limiting of task processing is guarded by feature flag.

Release notes

Documentation Changes

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Merging #5804 (58c6986) into master (7ef2456) will increase coverage by 0.00%.
The diff coverage is 89.28%.

❗ Current head 58c6986 differs from pull request most recent head eed2085. Consider uploading reports for the commit eed2085 to get more accurate results

Additional details and impacted files
Files Coverage Δ
...vice/history/task/transfer_active_task_executor.go 68.64% <100.00%> (+0.38%) ⬆️
service/history/engine/engineimpl/historyEngine.go 37.91% <0.00%> (-0.02%) ⬇️
service/history/handler/handler.go 10.38% <85.71%> (+0.06%) ⬆️
service/history/queue/transfer_queue_processor.go 0.00% <0.00%> (ø)

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ef2456...eed2085. Read the comment docs.

@coveralls
Copy link

coveralls commented Mar 21, 2024

Pull Request Test Coverage Report for Build 018e65a4-d74b-470b-8e14-ee4b052c9737

Details

  • 36 of 36 (100.0%) changed or added relevant lines in 5 files are covered.
  • 47 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.005%) to 65.386%

Files with Coverage Reduction New Missed Lines %
service/matching/taskReader.go 2 84.88%
common/util.go 2 91.78%
service/matching/taskListManager.go 3 80.2%
service/history/task/fetcher.go 3 85.57%
service/history/task/transfer_standby_task_executor.go 4 87.01%
service/frontend/wrappers/metered/metered.go 4 65.5%
common/task/fifo_task_scheduler.go 5 82.47%
common/persistence/statsComputer.go 6 93.57%
service/history/execution/mutable_state_task_refresher.go 7 62.34%
common/persistence/nosql/nosqlplugin/cassandra/workflow_parsing_utils.go 11 85.74%
Totals Coverage Status
Change from base Build 018e630f-5d23-4a96-b685-751208f2cd21: 0.005%
Covered Lines: 95594
Relevant Lines: 146200

💛 - Coveralls

@@ -198,8 +202,10 @@ func (t *transferActiveTaskExecutor) processActivityTask(
// the rest of logic is making RPC call, which takes time.
release(nil)

// Ratelimiting is not done. This is only to count the number of requests via metrics
t.wfIDCache.AllowInternal(task.DomainID, task.WorkflowID)
// Rate limiting task processing requests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason to apply this for activity and decision tasks only? Are you planning to expand to other task types later on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of processing boils down to these two task types and they are easier to reason about when we ratelimit users. But it is possible to expand if and when needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Child workflow related tasks are also common and cause hot shards. I recommend including them in the scope

@sankari165 sankari165 merged commit 2f67371 into cadence-workflow:master Mar 22, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants