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

Unload taskListManager by instance, not taskListID #5101

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

Shaddoll
Copy link
Contributor

What changed?
cherry pick temporalio/temporal#1917

Why?
see temporalio/temporal#1917

How did you test it?

Potential risks

Release notes

Documentation Changes

@coveralls
Copy link

Pull Request Test Coverage Report for Build 018656ac-ad37-41bc-9875-ff7d5930f3f7

  • 19 of 19 (100.0%) changed or added relevant lines in 2 files are covered.
  • 61 unchanged lines in 14 files lost coverage.
  • Overall coverage increased (+0.03%) to 57.198%

Files with Coverage Reduction New Missed Lines %
client/history/client.go 2 38.1%
client/history/metricClient.go 2 45.3%
common/membership/hashring.go 2 83.54%
common/task/weightedRoundRobinTaskScheduler.go 2 89.64%
service/history/handler.go 2 47.15%
service/history/queue/timer_gate.go 3 95.83%
service/matching/taskListManager.go 3 78.42%
common/persistence/serialization/parser.go 4 65.41%
common/persistence/serialization/thrift_decoder.go 4 61.22%
service/frontend/workflowHandler.go 4 60.17%
Totals Coverage Status
Change from base Build 01865647-f88a-4f36-8708-c19ac460d06c: 0.03%
Covered Lines: 85007
Relevant Lines: 148620

💛 - Coveralls


delete(e.taskLists, *id)
currentTlMgr, ok := e.taskLists[*id]
if ok && tlMgr == currentTlMgr {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add a comment as to why your'e checking both ID and instance referencing the description at temporalio/temporal#1917, since honestly it's a little confusing without looking at the PR and surrounding comment

if ok && tlMgr == currentTlMgr {
delete(e.taskLists, *id)
}
e.taskListsLock.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Would there be any reason to not defer this above the lock?

it's currently fine I think now, but if there's any other control flow changes It'd be easy to miss

}
delete(e.taskLists, *id)
e.taskListsLock.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can defer this too and only have a single instance of unlock?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want/need it to unlock before Stop() runs :\

in a more general sense though, yeah - I've been hoping we can come up with a better structure for these kinds of things. Now that we have generics, it might even be palatable to use an IIFE...

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, good point

@Shaddoll Shaddoll merged commit fe9c3ab into uber:master Feb 16, 2023
@Shaddoll Shaddoll deleted the refactor-matching branch February 16, 2023 00:18
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