Skip to content

Commit e553eda

Browse files
authored
HADOOP-16767 Handle non-IO exceptions in reopen()
Contributed by Sergei Poganshev. Catches Exception instead of IOException in closeStream() and so handle exceptions such as SdkClientException by aborting the wrapped stream. This will increase resilience to failures, as any which occuring during stream closure will be caught. Furthermore, because the underlying HTTP connection is aborted, rather than closed, it will not be recycled to cause problems on subsequent operations.
1 parent e9eeced commit e553eda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ private void closeStream(String reason, long length, boolean forceAbort) {
576576
// and an abort is triggered, the initial attempt's statistics
577577
// aren't collected.
578578
streamStatistics.streamClose(false, drained);
579-
} catch (IOException e) {
579+
} catch (Exception e) {
580580
// exception escalates to an abort
581581
LOG.debug("When closing {} stream for {}", uri, reason, e);
582582
shouldAbort = true;

0 commit comments

Comments
 (0)