FerArribas created RANGER-4943: ---------------------------------- Summary: Error in ElasticSearchAuditDestination shutting down RestHighLevelClient client Key: RANGER-4943 URL: https://issues.apache.org/jira/browse/RANGER-4943 Project: Ranger Issue Type: Bug Components: audit Affects Versions: 2.5.0 Reporter: FerArribas Assignee: FerArribas Fix For: 3.0.0
*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. -- This message was sent by Atlassian Jira (v8.20.10#820010)