[
https://issues.apache.org/jira/browse/BEAM-3026?focusedWorklogId=131986&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-131986
]
ASF GitHub Bot logged work on BEAM-3026:
----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Aug/18 18:35
Start Date: 07/Aug/18 18:35
Worklog Time Spent: 10m
Work Description: timrobertson100 commented on a change in pull request
#6146: BEAM-3026 Adding retrying behavior on ElasticSearchIO for 429: Too Many
Requests
URL: https://github.com/apache/beam/pull/6146#discussion_r208337744
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/io/common/retry/RetryConfiguration.java
##########
@@ -0,0 +1,80 @@
+package org.apache.beam.sdk.io.common.retry;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+import java.io.Serializable;
+import org.joda.time.Duration;
+
+/**
+ * A POJO encapsulating a configuration for retry behavior when issuing
requests. A retry will be
+ * attempted until the maxAttempts or maxDuration is exceeded, whichever comes
first, for any of the
+ * following exceptions:
+ */
+public class RetryConfiguration implements Serializable {
+
+ private int maxAttempts;
+ private Duration maxDuration;
+ private RetryPredicate retryPredicate;
Review comment:
The original design of `SolrIO` deliberately kept the predicate package
private and visible only for tests.
That design was chosen to abide by the policy of Beam IOs which is to only
expose tuning for those things that a user might reasonably need to tune. In
the case of retries the IO should be able to make the decision on when to do it
(noting that the underlying ES client already does most of them for ES) and
this shouldn't be exposed to the user to modify.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 131986)
Time Spent: 1h 10m (was: 1h)
> Improve retrying in ElasticSearch client
> ----------------------------------------
>
> Key: BEAM-3026
> URL: https://issues.apache.org/jira/browse/BEAM-3026
> Project: Beam
> Issue Type: Improvement
> Components: io-java-elasticsearch
> Reporter: Tim Robertson
> Assignee: Ravi Pathak
> Priority: Major
> Fix For: 2.6.0
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Currently an overloaded ES server will result in clients failing fast.
> I suggest implementing backoff pauses. Perhaps something like this:
> {code}
> ElasticsearchIO.ConnectionConfiguration conn =
> ElasticsearchIO.ConnectionConfiguration
> .create(new String[]{"http://...:9200"}, "test", "test")
> .retryWithWaitStrategy(WaitStrategies.exponentialBackoff(1000,
> TimeUnit.MILLISECONDS)
> .retryWithStopStrategy(StopStrategies.stopAfterAttempt(10)
> );
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)