Github user tzulitai commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1962#discussion_r123150100
  
    --- Diff: 
flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkBase.java
 ---
    @@ -234,4 +255,36 @@ private void checkErrorAndRethrow() {
                        throw new RuntimeException("An error occured in 
ElasticsearchSink.", cause);
                }
        }
    +
    +   private void retry(T value) throws Exception {
    +           int retryCounter = 1;
    +
    +           while (retryCounter <= connectionRetries) {
    +                   if (bulkProcessor != null) {
    +                           bulkProcessor.close();
    +                           bulkProcessor = null;
    +                   }
    +
    +                   if (client != null) {
    +                           client.close();
    +                   }
    +
    +                   try {
    +                           open(null);
    --- End diff --
    
    This open() call seems a bit odd to me. I don't think its a good practice 
to call that here, since essentially its a life cycle method used by the system.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to