fabriziofortino commented on code in PR #490:
URL: https://github.com/apache/jackrabbit-oak/pull/490#discussion_r872081117


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnection.java:
##########
@@ -135,8 +180,11 @@ public boolean isAvailable() {
 
     @Override
     public synchronized void close() throws IOException {
-        if (client != null) {
-            client.close();
+        if (esClient != null) {
+               esClient._transport().close();

Review Comment:
   Both clients are based on the same transport layer. We just need to close 
one. Added a comment to clarify that.



##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticBulkProcessorHandler.java:
##########
@@ -161,7 +160,7 @@ private BulkProcessor initBulkProcessor() {
     }
 
     protected BiConsumer<BulkRequest, ActionListener<BulkResponse>> 
requestConsumer() {
-        return (request, bulkListener) -> 
elasticConnection.getClient().bulkAsync(request, RequestOptions.DEFAULT, 
bulkListener);
+        return (request, bulkListener) -> 
elasticConnection.getOldClient().bulkAsync(request, RequestOptions.DEFAULT, 
bulkListener);

Review Comment:
   Done



-- 
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]

Reply via email to