Skip to content

Commit 5f34529

Browse files
committed
HADOOP-18526. checkstyle and TRACE of stack in s3afs.initialize()
off by default...test/log4j.properties has it commented out Change-Id: Ie83b74009ccae8869b2c5386206b913e0f76af2f
1 parent 5bbd748 commit 5f34529

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,12 @@ public void initialize(URI name, Configuration originalConf)
458458
AuditSpan span = null;
459459
try {
460460
LOG.debug("Initializing S3AFileSystem for {}", bucket);
461+
if (LOG.isTraceEnabled()) {
462+
// log a full trace for deep diagnostics of where an object is created,
463+
// for tracking down memory leak issues.
464+
LOG.trace("Filesystem for {} creation stack",
465+
name, new RuntimeException(super.toString()));
466+
}
461467
// clone the configuration into one with propagated bucket options
462468
Configuration conf = propagateBucketOptions(originalConf, bucket);
463469
// HADOOP-17894. remove references to s3a stores in JCEKS credentials.

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/TestInstrumentationLifecycle.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import org.junit.Test;
2424

25-
import org.apache.hadoop.fs.statistics.StoreStatisticNames;
2625
import org.apache.hadoop.metrics2.MetricsSystem;
2726
import org.apache.hadoop.test.AbstractHadoopTestBase;
2827

hadoop-tools/hadoop-aws/src/test/resources/log4j.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ log4j.logger.org.apache.hadoop.ipc.Server=WARN
5353
# for debugging low level S3a operations, uncomment these lines
5454
# Log all S3A classes
5555
log4j.logger.org.apache.hadoop.fs.s3a=DEBUG
56+
# when logging at trace, the stack of the initialize() call is logged
57+
#log4j.logger.org.apache.hadoop.fs.s3a.S3AFileSystem=TRACE
5658
#log4j.logger.org.apache.hadoop.fs.s3a.S3AUtils=INFO
5759
#log4j.logger.org.apache.hadoop.fs.s3a.Listing=INFO
5860
log4j.logger.org.apache.hadoop.fs.s3a.SDKV2Upgrade=WARN

0 commit comments

Comments
 (0)