瀏覽代碼

HADOOP-16767 Handle non-IO exceptions in reopen() (#2685)

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.
yzhangal 4 年之前
父節點
當前提交
ceea43115b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInputStream.java

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

@@ -476,7 +476,7 @@ public class S3AInputStream extends FSInputStream implements CanSetReadahead {
           // and an abort is triggered, the initial attempt's statistics
           // aren't collected.
           streamStatistics.streamClose(false, drained);
-        } catch (IOException e) {
+        } catch (Exception e) {
           // exception escalates to an abort
           LOG.debug("When closing {} stream for {}", uri, reason, e);
           shouldAbort = true;