Skip to content

Commit f347b64

Browse files
HADOOP-19567. S3A: error stack traces printed on analytics stream factory close (#7701)
Contributed by Steve Loughran
1 parent 949292e commit f347b64

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/streams/AnalyticsStreamFactory.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
import java.io.IOException;
2323

24+
import org.slf4j.Logger;
25+
import org.slf4j.LoggerFactory;
2426
import software.amazon.s3.analyticsaccelerator.S3SdkObjectClient;
2527
import software.amazon.s3.analyticsaccelerator.S3SeekableInputStreamConfiguration;
2628
import software.amazon.s3.analyticsaccelerator.S3SeekableInputStreamFactory;
@@ -40,6 +42,8 @@
4042
* {@code S3AStore}, if fs.s3a.input.stream.type is set to Analytics.
4143
*/
4244
public class AnalyticsStreamFactory extends AbstractObjectInputStreamFactory {
45+
private static final Logger LOG =
46+
LoggerFactory.getLogger(AnalyticsStreamFactory.class);
4347

4448
private S3SeekableInputStreamConfiguration seekableInputStreamConfiguration;
4549
private LazyAutoCloseableReference<S3SeekableInputStreamFactory> s3SeekableInputStreamFactory;
@@ -98,7 +102,11 @@ public StreamFactoryRequirements factoryRequirements() {
98102

99103
@Override
100104
protected void serviceStop() throws Exception {
101-
this.s3SeekableInputStreamFactory.close();
105+
try {
106+
s3SeekableInputStreamFactory.close();
107+
} catch (Exception ignored) {
108+
LOG.debug("Ignored exception while closing stream factory", ignored);
109+
}
102110
callbacks().incrementFactoryStatistic(ANALYTICS_STREAM_FACTORY_CLOSED);
103111
super.serviceStop();
104112
}

0 commit comments

Comments
 (0)