[
https://issues.apache.org/jira/browse/RANGER-4943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Abhishek Kumar updated RANGER-4943:
-----------------------------------
Fix Version/s: 2.6.0
(was: 3.0.0)
> 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
> Priority: Major
> Fix For: 2.6.0
>
> Attachments:
> 0001-RANGER-4943-Error-in-ElasticSearchAuditDestination-s.patch
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> *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)