[GitHub] [flink] dannycranmer commented on a change in pull request #17785: [FLINK-24580][Connectors/Kinesis] Make ConnectTimeoutException recoverable

2021-11-23 Thread GitBox


dannycranmer commented on a change in pull request #17785:
URL: https://github.com/apache/flink/pull/17785#discussion_r755268744



##
File path: 
flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/KinesisProxy.java
##
@@ -420,6 +421,8 @@ private String getShardIterator(GetShardIteratorRequest 
getShardIteratorRequest)
 protected boolean isRecoverableSdkClientException(SdkClientException ex) {
 if (ex instanceof AmazonServiceException) {
 return 
KinesisProxy.isRecoverableException((AmazonServiceException) ex);
+} else if (ex.getCause() instanceof ConnectTimeoutException) {

Review comment:
   nit: You could use `ExceptionUtils#hasCause` incase the exception gets 
wrapped:
   - 
https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/exception/ExceptionUtils.html#hasCause-java.lang.Throwable-java.lang.Class-




-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [flink] dannycranmer commented on a change in pull request #17785: [FLINK-24580][Connectors/Kinesis] Make ConnectTimeoutException recoverable

2021-11-23 Thread GitBox


dannycranmer commented on a change in pull request #17785:
URL: https://github.com/apache/flink/pull/17785#discussion_r755780760



##
File path: 
flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/proxy/KinesisProxy.java
##
@@ -420,6 +421,8 @@ private String getShardIterator(GetShardIteratorRequest 
getShardIteratorRequest)
 protected boolean isRecoverableSdkClientException(SdkClientException ex) {
 if (ex instanceof AmazonServiceException) {
 return 
KinesisProxy.isRecoverableException((AmazonServiceException) ex);
+} else if (ex.getCause() instanceof ConnectTimeoutException) {

Review comment:
   Yes I agree, either approach is fine. I will wait for an update and 
merge once tests pass




-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org