[ 
https://issues.apache.org/jira/browse/RANGER-4943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17915859#comment-17915859
 ] 

Abhishek Kumar edited comment on RANGER-4943 at 1/21/25 11:25 PM:
------------------------------------------------------------------

Thank you for the patch [~ferarribas].
The patch has been merged in master: 
[https://github.com/apache/ranger/commit/0a09509] 
Merged in [ranger-2.6|https://github.com/apache/ranger/commit/7a6c0f6]


was (Author: abhi_2110):
Thank you for the patch [~ferarribas].
The patch has been merged in master: 
[https://github.com/apache/ranger/commit/0a09509] 

> 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: 3.0.0
>
>         Attachments: 
> 0001-RANGER-4943-Error-in-ElasticSearchAuditDestination-s.patch
>
>          Time Spent: 0.5h
>  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)

Reply via email to