vikaskr22 opened a new pull request, #575:
URL: https://github.com/apache/ranger/pull/575
…rse config everytime
## What changes were proposed in this pull request?
KMS metrics collector checks before collection whether the collection is
thread-safe or not. Default is false. This config was introduced to avoid
unnecessary locking for the non-functional metrics. But for businesses where
metrics need to be accurate, it can be marked true. To check this flag,
existing code was reading the config value from kmsConf every time. And this
required to create one Configuration object and this acquires lock on the
underlying config. Hence it was blocking many other threads who actually needs
to parse and read something.
I have noticed around 30-40 threads always waiting for the kmsConf lock and
it was acquired by the thread that was simply checking whether metric
collection is thread safe or not.
Since this config doesn't change during execution, It can be simply read and
kept during initialisation once , and can be read from there whenever required.
## How was this patch tested?
Build got passed, Unit tests got passed.
Further I created ranger-kms docker image and verified the metric collection
by hitting metric API.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]