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

Emit metrics when transfer tasks could be ratelimited #5652

Merged
merged 4 commits into from
Feb 9, 2024

Conversation

sankari165
Copy link
Contributor

What changed?
Adding call to workflowID cache based ratelimiter during transfer task execution

Why?
to get metrics on potential hot shards and investigate when requests will be ratelimited

How did you test it?
tested locally and added unit tests

Potential risks

Release notes

Documentation Changes

@coveralls
Copy link

coveralls commented Feb 9, 2024

Pull Request Test Coverage Report for Build 018d8e6b-9771-49d7-b2ee-9f71a53ac1b3

  • 0 of 9 (100.0%) changed or added relevant lines in 6 files are covered.
  • 64 unchanged lines in 15 files lost coverage.
  • Overall coverage increased (+0.03%) to 62.682%

Files with Coverage Reduction New Missed Lines %
common/persistence/sql/common.go 2 72.73%
common/persistence/sql/sqlplugin/mysql/db.go 2 83.33%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
service/history/execution/mutable_state_builder.go 2 68.64%
service/matching/db.go 2 73.23%
common/log/tag/tags.go 3 50.46%
common/persistence/statsComputer.go 3 94.29%
common/task/fifo_task_scheduler.go 3 84.54%
service/history/queue/timer_queue_processor_base.go 3 77.82%
service/history/task/fetcher.go 4 85.05%
Totals Coverage Status
Change from base Build 018d8cd7-6838-492b-a76e-894fb1359925: 0.03%
Covered Lines: 92229
Relevant Lines: 147137

💛 - Coveralls

@sankari165 sankari165 enabled auto-merge (squash) February 9, 2024 15:32
@sankari165 sankari165 merged commit eec8f6d into cadence-workflow:master Feb 9, 2024
16 checks passed
@sankari165 sankari165 deleted the CDNC-6549 branch February 9, 2024 15:37
@@ -99,6 +103,9 @@ func (t *transferTaskExecutorBase) pushActivity(
t.logger.Fatal("Cannot process non activity task", tag.TaskType(task.GetTaskType()))
}

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

Choose a reason for hiding this comment

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

This function is called by transfer active task executor and transfer standby task executor. Are we going to count those together in same rate limit quota?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats a good catch. I have considered to address this in a follow up PR

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.

4 participants