You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/09/21 18:46:53 UTC
[GitHub] [hadoop] steveloughran commented on a change in pull request #2321: HADOOP-17267: Add debug-level logs in Filesystem#close
steveloughran commented on a change in pull request #2321:
URL: https://github.com/apache/hadoop/pull/2321#discussion_r492270963
##########
File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
##########
@@ -621,6 +621,9 @@ public static LocalFileSystem newInstanceLocal(Configuration conf)
* @throws IOException a problem arose closing one or more filesystem.
*/
public static void closeAll() throws IOException {
+ if (LOGGER.isDebugEnabled()) {
+ debugLogFileSystemClose("closeAll", null);
Review comment:
pass in "" instead of null and theres' no need for the ? : below
##########
File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
##########
@@ -632,9 +635,21 @@ public static void closeAll() throws IOException {
*/
public static void closeAllForUGI(UserGroupInformation ugi)
throws IOException {
+ if (LOGGER.isDebugEnabled()) {
+ debugLogFileSystemClose("closeAllForUGI", "UGI: " + ugi.toString());
Review comment:
just use ugi and let the automatic to.String to the work
##########
File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
##########
@@ -632,9 +635,21 @@ public static void closeAll() throws IOException {
*/
public static void closeAllForUGI(UserGroupInformation ugi)
throws IOException {
+ if (LOGGER.isDebugEnabled()) {
+ debugLogFileSystemClose("closeAllForUGI", "UGI: " + ugi.toString());
+ }
CACHE.closeAll(ugi);
}
+ private static void debugLogFileSystemClose(String methodName, String additionalInfo) {
+ StackTraceElement callingMethod = new Throwable().fillInStackTrace().getStackTrace()[2];
+ LOGGER.debug(
+ "FileSystem." + methodName + "() called by method: "
Review comment:
Prefer SLF4J {} and the values as varargs.
You might want to think that at TRACE the entire throwable is logged. Why so? one level up isn't always enough
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org