----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/75218/ -----------------------------------------------------------
Review request for ranger. Repository: ranger Description ------- Error encountered -> ElasticSearchAccessAuditsServiceTest -> ERROR org.apache.ranger.audit.provider.BaseAuditHandler – Error sending message to ElasticSearch java.lang.RuntimeException: Cannot execute request; I/O reactor status: STOPPED</resthighlevelclient>. Details: Error in using a try-with-resources block in ElasticSearchAuditDestination because it closes the ElasticSearch client prematurely. In a try-with-resources block, any resource that implements the AutoCloseable interface will automatically close at the end of the block, which may cause the ElasticSearch client to close before its use is complete. To avoid this problem, we remove the try-with-resources usage for the ElasticSearch client because it already explicitly closes the client when it is no longer needed, specifically in RestHighLevelClient which implements Closeable's close method. Diffs ----- agents-audit/src/main/java/org/apache/ranger/audit/destination/ElasticSearchAuditDestination.java 8324d998b Diff: https://reviews.apache.org/r/75218/diff/1/ Testing ------- OK File Attachments ---------------- AuditsApacheRanger.png https://reviews.apache.org/media/uploaded/files/2024/09/27/0dfe1b84-efdb-456a-bb16-25110f8b1760__AuditsApacheRanger.png test3 https://reviews.apache.org/media/uploaded/files/2024/09/27/4806f019-aba1-4dd5-aee8-12281b1816df__DocsElastic.png Test2 https://reviews.apache.org/media/uploaded/files/2024/09/27/962e9c52-3f14-4121-a491-58d6a652ca72__ExampleDoc.png Thanks, Fernando Arribas