doleyzi opened a new pull request, #12138: URL: https://github.com/apache/inlong/pull/12138
- Fixes #12137 ### Motivation The Audit SDK is called concurrently by multi-threaded components but is not thread-safe: non-thread-safe containers and non-atomic counter updates in the aggregation path cause lost/duplicated metrics and intermittent ConcurrentModificationException / NullPointerException. All public APIs (add / send / flush) should be thread-safe by contract. ### Modifications Replaced unsafe containers and counters in the aggregation path with ConcurrentHashMap and LongAdder / AtomicLong, reworked flush/send into a snapshot-and-swap path so producers and the flush thread never block or lose entries, and ensured all public APIs (add / send / flush) only operate on thread-safe state. Added N×M concurrent unit tests asserting exact totals with no exceptions. -- 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]
