[ 
https://issues.apache.org/jira/browse/HADOOP-17267?focusedWorklogId=488886&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-488886
 ]

ASF GitHub Bot logged work on HADOOP-17267:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Sep/20 04:17
            Start Date: 23/Sep/20 04:17
    Worklog Time Spent: 10m 
      Work Description: klcopp commented on a change in pull request #2321:
URL: https://github.com/apache/hadoop/pull/2321#discussion_r492695507



##########
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:
       Hi Steve, thanks for taking a look at this!
   Could you clarify what you mean by this?: 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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 488886)
    Time Spent: 2h  (was: 1h 50m)

> Add debug-level logs in Filesystem#close
> ----------------------------------------
>
>                 Key: HADOOP-17267
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17267
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 3.3.0
>            Reporter: Karen Coppage
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> HDFS reuses the same cached FileSystem object across the file system. If the 
> client calls FileSystem.close(), closeAllForUgi(), or closeAll() (if it 
> applies to the instance) anywhere in the system it purges the cache of that 
> FS instance, and trying to use the instance results in an IOException: 
> FileSystem closed.
> It would be a great help to clients to see where and when a given FS instance 
> was closed. I.e. in close(), closeAllForUgi(), or closeAll(), it would be 
> great to see a DEBUG-level log of
>  * calling method name, class, file name/line number
>  * FileSystem object's identity hash (FileSystem.close() only)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to