kinolaev commented on code in PR #15792:
URL: https://github.com/apache/iceberg/pull/15792#discussion_r3009987068
##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3InputStream.java:
##########
@@ -55,6 +55,12 @@ class S3InputStream extends SeekableInputStream implements
RangeReadable {
private static final List<Class<? extends Throwable>> RETRYABLE_EXCEPTIONS =
ImmutableList.of(SSLException.class, SocketTimeoutException.class,
SocketException.class);
+ private static boolean isPrematureConnectionClose(Throwable ex) {
+ return ex.getClass().getSimpleName().equals("ConnectionClosedException")
+ && ex.getMessage() != null
+ && ex.getMessage().startsWith("Premature end of Content-Length
delimited message body");
Review Comment:
Yes, it definitely looks fragile and it most probably doesn't work for
urlconnection client, but I couldn't find a better way.
ConnectionClosedException is already identified by its simple name
[here](https://github.com/kinolaev/iceberg/blob/e4d88c9ebe5b461b12dc60c1d6704c79d39853e9/aws/src/main/java/org/apache/iceberg/aws/s3/S3InputStream.java#L276-L280).
There are many different cases of
[ConnectionClosedException](https://github.com/search?q=repo%3Aapache%2Fhttpcomponents-core+new+ConnectionClosedException&type=code)
in apache http client that are distinguished only by their error messages. And
I doubt that we should add all of them to the retry policy.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]