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

matching: metrics related fixes #1908

Merged
merged 5 commits into from
May 29, 2019
Merged

Conversation

venkat1109
Copy link
Contributor

@venkat1109 venkat1109 commented May 28, 2019

Follow patch to #1906. The domainScope was assigned within a lock however it was accessed throughout the code without acquiring any locks. This patch fixes the bug and also gets rid of the locks, in favor of atomics.

There was also another existing bug - the metricsClient was never initialized in the constructor. Also, fixes this problem

@venkat1109 venkat1109 self-assigned this May 28, 2019
Copy link
Collaborator

@longquanzheng longquanzheng left a comment

Choose a reason for hiding this comment

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

If what you concern about race condition, let's revert my previous PR because what you are doing here is exactly the same thing as DomainCache does. See https://github.com/uber/cadence/blob/master/common/cache/domainCache.go#L89
So it doesn't improve much perf compared to directly using domainCache. Instead, it over complicates things because you are building another cache over cache.

@venkat1109
Copy link
Contributor Author

So it doesn't improve much perf compared to directly using domainCache
This patch caches the domain metric scope once it's created not the domain metadata. That's about it. DomainCache caches the domain metadata. And I tend to disagree that it's complicated.

@longquanzheng
Copy link
Collaborator

So it doesn't improve much perf compared to directly using domainCache
This patch caches the domain metric scope once it's created not the domain metadata. That's about it. DomainCache caches the domain metadata. And I tend to disagree that it's complicated.

I am fine to forget about complexity as it's hard to argue. Adding another atomicValue is unnecessary. How about just use domainCache whenever you need to translate from domainID to domainName?

@venkat1109
Copy link
Contributor Author

So it doesn't improve much perf compared to directly using domainCache
This patch caches the domain metric scope once it's created not the domain metadata. That's about it. DomainCache caches the domain metadata. And I tend to disagree that it's complicated.

I am fine to forget about complexity as it's hard to argue. Adding another atomicValue is unnecessary. How about just use domainCache whenever you need to translate from domainID to domainName?

Discussed offline.

@venkat1109 venkat1109 changed the title matching: followup to #1906 matching: metrics related fixes May 29, 2019
@venkat1109 venkat1109 merged commit 58092d6 into uber:master May 29, 2019
@venkat1109 venkat1109 deleted the matching_fix branch May 29, 2019 20:57
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