-
Notifications
You must be signed in to change notification settings - Fork 791
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
Conversation
There was a problem hiding this 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.
|
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. |
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