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

Refactor matching and split the files into subpackages #6000

Merged
merged 1 commit into from May 13, 2024

Conversation

Shaddoll
Copy link
Contributor

@Shaddoll Shaddoll commented May 9, 2024

What changed?
Refactor matching and split the files into subpackages

Why?
To improve the quality of the codebase

How did you test it?
existing unit tests

Potential risks
The risk is a bit high because it changes almost everything inside matching packages by splitting the files into subpackages. We need at 2 pairs of eyes for reviewing this PR.

Release notes

Documentation Changes

Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 78.45745% with 81 lines in your changes are missing coverage. Please review.

Project coverage is 66.05%. Comparing base (2fef3c3) to head (4dda545).

Additional details and impacted files
Files Coverage Δ
service/matching/handler/context.go 9.61% <100.00%> (ø)
service/matching/handler/handler.go 0.00% <ø> (ø)
service/matching/liveness/liveness.go 94.59% <100.00%> (ø)
service/matching/tasklist/db.go 72.41% <ø> (ø)
service/matching/tasklist/forwarder.go 95.30% <100.00%> (ø)
service/matching/tasklist/identifier.go 100.00% <100.00%> (ø)
service/matching/tasklist/task_gc.go 86.66% <100.00%> (ø)
service/matching/tasklist/task_writer.go 77.77% <ø> (ø)
service/matching/wrappers/thrift/thrift_handler.go 62.50% <100.00%> (ø)
service/matching/tasklist/matcher.go 79.91% <85.00%> (ø)
... and 4 more

... and 9 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 2fef3c3...4dda545. Read the comment docs.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 018f5f66-582f-4a02-8ecc-259a2c7f45b8

Details

  • 508 of 648 (78.4%) changed or added relevant lines in 16 files are covered.
  • 30 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-0.05%) to 68.762%

Changes Missing Coverage Covered Lines Changed/Added Lines %
service/matching/tasklist/task_reader.go 4 6 66.67%
host/taskpoller.go 0 3 0.0%
service/matching/tasklist/matcher.go 17 20 85.0%
service/matching/tasklist/task.go 25 28 89.29%
service/matching/poller/history.go 7 11 63.64%
service/matching/tasklist/task_list_manager.go 142 158 89.87%
service/matching/handler/engine.go 114 131 87.02%
service/matching/tasklist/testing.go 143 235 60.85%
Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 1 89.05%
service/history/task/fetcher.go 2 85.57%
common/task/fifo_task_scheduler.go 3 84.54%
common/persistence/statsComputer.go 3 96.07%
service/frontend/api/handler.go 4 62.2%
service/history/task/cross_cluster_task_processor.go 8 80.79%
service/history/engine/engineimpl/poll_mutable_state.go 9 74.16%
Totals Coverage Status
Change from base Build 018f5e8f-a247-406e-9920-f997ba145d18: -0.05%
Covered Lines: 101217
Relevant Lines: 147199

💛 - Coveralls

service/matching/poller/history.go Show resolved Hide resolved
@@ -138,19 +153,26 @@ const (
maxSyncMatchWaitTime = 200 * time.Millisecond
)

var _ taskListManager = (*taskListManagerImpl)(nil)
var _ Manager = (*taskListManagerImpl)(nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this is not needed

}
activityTaskListMap[tl.baseName] = tlm.DescribeTaskList(false)
// TODO: review this logic
Copy link
Contributor

Choose a reason for hiding this comment

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

mind putting in the comment what seems off?

dPtr := _defaultTaskDispatchRPS
limiter := quotas.NewRateLimiter(&dPtr, _defaultTaskDispatchRPSTTL, config.MinTaskThrottlingBurstSize())
func newTaskMatcher(config *config.TaskListConfig, fwdr *Forwarder, scope metrics.Scope, isolationGroups []string, log log.Logger) *TaskMatcher {
dPtr := config.TaskDispatchRPS
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this what you were referring to as having to be pulled into a central location?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the central location of the default values is config/config.go

Copy link
Contributor

@davidporter-id-au davidporter-id-au left a comment

Choose a reason for hiding this comment

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

lgtm, actually looks a lot better

@Shaddoll Shaddoll merged commit 6108a44 into uber:master May 13, 2024
20 checks passed
@Shaddoll Shaddoll deleted the matching branch May 13, 2024 16:58
abhishekj720 pushed a commit to abhishekj720/cadence that referenced this pull request May 13, 2024
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.

None yet

4 participants