aljoscha commented on a change in pull request #10936: [FLINK-13689] 
[Connectors/ElasticSearch] Fix thread leak in Elasticsearch connector when 
cluster is down
URL: https://github.com/apache/flink/pull/10936#discussion_r370527319
 
 

 ##########
 File path: 
flink-connectors/flink-connector-elasticsearch6/src/main/java/org/apache/flink/streaming/connectors/elasticsearch6/Elasticsearch6ApiCallBridge.java
 ##########
 @@ -139,4 +127,19 @@ public RequestIndexer createBulkProcessorIndexer(
                        flushOnCheckpoint,
                        numPendingRequestsRef);
        }
+
+       @Override
+       public void verifyClientConnection(RestHighLevelClient client) throws 
IOException {
+               if (LOG.isInfoEnabled()) {
+                       LOG.info("Pinging Elasticsearch cluster via hosts {} 
...", httpHosts);
+               }
+
+               if (!client.ping()) {
+                       throw new RuntimeException("There are no reachable 
Elasticsearch nodes!");
+               }
+
+               if (LOG.isInfoEnabled()) {
+                       LOG.info("Created Elasticsearch RestHighLevelClient 
connected to {}", httpHosts.toString());
 
 Review comment:
   ```suggestion
                        LOG.info("Elasticsearch RestHighLevelClient is 
connected to {}", httpHosts.toString());
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to