HADOOP-13323. Downgrade stack trace on FS load from Warn to debug. Contributed by Steve Loughran.
(cherry picked from commit2d46c3f6b7
) (cherry picked from commitecccb114ae
)
This commit is contained in:
parent
319b101b7e
commit
b9ce40e12c
|
@ -2764,7 +2764,15 @@ public abstract class FileSystem extends Configured implements Closeable {
|
||||||
ClassUtil.findContainingJar(fs.getClass()), e);
|
ClassUtil.findContainingJar(fs.getClass()), e);
|
||||||
}
|
}
|
||||||
} catch (ServiceConfigurationError ee) {
|
} catch (ServiceConfigurationError ee) {
|
||||||
LOG.warn("Cannot load filesystem", ee);
|
LOG.warn("Cannot load filesystem: " + ee);
|
||||||
|
Throwable cause = ee.getCause();
|
||||||
|
// print all the nested exception messages
|
||||||
|
while (cause != null) {
|
||||||
|
LOG.warn(cause.toString());
|
||||||
|
cause = cause.getCause();
|
||||||
|
}
|
||||||
|
// and at debug: the full stack
|
||||||
|
LOG.debug("Stack Trace", ee);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FILE_SYSTEMS_LOADED = true;
|
FILE_SYSTEMS_LOADED = true;
|
||||||
|
|
|
@ -47,16 +47,12 @@ public class TestFileSystemInitialization {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingLibraries() {
|
public void testMissingLibraries() {
|
||||||
boolean catched = false;
|
|
||||||
try {
|
try {
|
||||||
Configuration conf = new Configuration();
|
Configuration conf = new Configuration();
|
||||||
FileSystem.getFileSystemClass("s3a", conf);
|
Class<? extends FileSystem> fs = FileSystem.getFileSystemClass("s3a",
|
||||||
} catch (Exception e) {
|
conf);
|
||||||
catched = true;
|
fail("Expected an exception, got a filesystem: " + fs);
|
||||||
} catch (ServiceConfigurationError e) {
|
} catch (Exception | ServiceConfigurationError expected) {
|
||||||
// S3A shouldn't find AWS SDK and fail
|
|
||||||
catched = true;
|
|
||||||
}
|
}
|
||||||
assertTrue(catched);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue