Github user tzulitai commented on a diff in the pull request:
https://github.com/apache/flink/pull/1962#discussion_r123149965
--- 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);
+ elasticsearchSinkFunction.process(value,
getRuntimeContext(), requestIndexer);
+ } catch (Exception ex) {
+ if (client instanceof TransportClient &&
!callBridge.isConnected(((TransportClient) client))) {
+ TimeUnit.SECONDS.sleep(3);
--- End diff --
Should this be configurable?
Also, could you explain a bit on why you've chosen 3 seconds?
---
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.
---