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

Small refactoring of task writer #5092

Merged
merged 1 commit into from
Feb 13, 2023
Merged

Conversation

Shaddoll
Copy link
Contributor

@Shaddoll Shaddoll commented Feb 13, 2023

What changed?
Move some methods from taskListManagerImpl to taskWriter

Why?
These methods are only used by taskWriter, thus it can improve the readability of the code.

How did you test it?

Potential risks

Release notes

Documentation Changes

@coveralls
Copy link

Pull Request Test Coverage Report for Build 01864c23-21c7-4d86-8e15-092dd3e7ba45

  • 46 of 58 (79.31%) changed or added relevant lines in 2 files are covered.
  • 39 unchanged lines in 13 files lost coverage.
  • Overall coverage increased (+0.07%) to 57.262%

Changes Missing Coverage Covered Lines Changed/Added Lines %
service/matching/taskListManager.go 8 9 88.89%
service/matching/taskWriter.go 38 49 77.55%
Files with Coverage Reduction New Missed Lines %
service/history/execution/mutable_state_task_refresher.go 1 71.2%
service/matching/taskListManager.go 1 79.33%
client/history/client.go 2 38.1%
client/history/metricClient.go 2 45.3%
common/task/weightedRoundRobinTaskScheduler.go 2 89.64%
service/history/execution/mutable_state_builder.go 2 68.79%
service/history/handler.go 2 47.28%
common/task/fifoTaskScheduler.go 3 84.54%
service/history/task/fetcher.go 3 91.75%
service/frontend/workflowHandler.go 4 59.98%
Totals Coverage Status
Change from base Build 01863d78-c3f5-4589-952d-5a1ae307a80e: 0.07%
Covered Lines: 85090
Relevant Lines: 148597

💛 - Coveralls

}
}

func (w *taskWriter) Start(block taskIDBlock) {
func (w *taskWriter) Start() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

this this called anywhere else? I would just be worried about calling SetAckLevel erroneously

Copy link
Contributor

Choose a reason for hiding this comment

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

its not, so that's all good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SetAckLevel doesn't return error
it's called inside start method of tasklistmanager

}
}

func (w *taskWriter) Start(block taskIDBlock) {
func (w *taskWriter) Start() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

its not, so that's all good

@@ -172,7 +225,7 @@ writerLoop:
maxReadLevel = taskIDs[i]
}

r, err := w.tlMgr.db.CreateTasks(tasks)
r, err := w.db.CreateTasks(tasks)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, that bidirectional reference thing is confusing

@Shaddoll Shaddoll merged commit dd95446 into uber:master Feb 13, 2023
@Shaddoll Shaddoll deleted the refactor-matching branch February 13, 2023 20:43
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

3 participants