tzulitai commented on a change in pull request #6482: [FLINK-10020] [kinesis] 
Support recoverable exceptions in listShards.
URL: https://github.com/apache/flink/pull/6482#discussion_r207447268
 
 

 ##########
 File path: 
flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/KinesisProxy.java
 ##########
 @@ -433,6 +440,16 @@ private ListShardsResult listShards(String streamName, 
@Nullable String startSha
                        } catch (ExpiredNextTokenException expiredToken) {
                                LOG.warn("List Shards has an expired token. 
Reusing the previous state.");
                                break;
+                       } catch (SdkClientException ex) {
+                               if (isRecoverableSdkClientException(ex)) {
+                                       long backoffMillis = fullJitterBackoff(
+                                               listShardsBaseBackoffMillis, 
listShardsMaxBackoffMillis, listShardsExpConstant, attemptCount++);
+                                       LOG.warn("Got SdkClientException when 
listing shards from stream {}. Backing off for {} millis.",
+                                               streamName, backoffMillis);
+                                       Thread.sleep(backoffMillis);
 
 Review comment:
   I'm wondering what kind of `SdkClientException`s there are. Do we really 
need to have a backoff here before retrying?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to