Vikas Kumar created RANGER-5895:
-----------------------------------
Summary: By default keep KMS metric collection thread-safe
Key: RANGER-5895
URL: https://issues.apache.org/jira/browse/RANGER-5895
Project: Ranger
Issue Type: Task
Components: kms
Reporter: Vikas Kumar
Assignee: Vikas Kumar
*Current behaviour:* Current implementation supports both thread-safe and
non-thread safe metrics collection. It was kept this way for performance
reasons. And non-thread-safe is the default behaviour.
This behaviour is configurable using following property:
{code:java}
config file: kms-site.xml
Prop: hadoop.kms.metric.collection.threadsafe
Value: true
{code}
In some environment, following was observed and it was failing the decrypt
requests in load was significantly high.
{code:java}
8902-2026-11-20 09:53:56,688 ERROR org.apache.hadoop.crypto.key.kms.server.KMS:
[https-jsse-nio-9494-exec-5]: Exception in handleEncryptedKeyOp.
8903:java.util.ConcurrentModificationException 8904- at
java.base/java.util.HashMap.compute(HashMap.java:1317) 8905- at
org.apache.ranger.kms.metrics.collector.KMSMetricsCollector.updateMetric(KMSMetricsCollector.java:84)
8906- at
org.apache.ranger.kms.metrics.collector.KMSMetricsCollector$APIMetric.close(KMSMetricsCollector.java:128)
8907- at
org.apache.hadoop.crypto.key.kms.server.KMS.handleEncryptedKeyOp(KMS.java:727)
8908- at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) 8909- at {code}
*Change expected:* Make the thread-safe collection as default behaviour.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)