Hi Rangers,

I am a developer who wants to implement a new audit destination similar to
Solr. I observed that many places are using synchronization[1][2]. I wonder
if this is needed to ensure the audit destination is thread-safe? In audit
V3 configuration, audit events are always sent to a queue which is single
threaded then eventually transferred to the audit destination. The only
other thread that can write to the audit destination is file spooler. It
looks to me that at most, two threads can compete with each other. Is that
the reason we want to make audit destination thread-safe?

In a word, could you advise what's the right expectation on the
thread-safety of audit destination?

[1]
https://github.com/apache/ranger/blob/f117b1c245d2f388d262425276e5e9f81f0c9248/agents-audit/src/main/java/org/apache/ranger/audit/destination/HDFSAuditDestination.java#L133
[2]
https://github.com/apache/ranger/blob/f117b1c245d2f388d262425276e5e9f81f0c9248/agents-audit/src/main/java/org/apache/ranger/audit/destination/SolrAuditDestination.java#L104

Thanks,
Yao

Reply via email to