[ 
https://issues.apache.org/jira/browse/HADOOP-18958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17780854#comment-17780854
 ] 

ASF GitHub Bot commented on HADOOP-18958:
-----------------------------------------

hiwangzhihui commented on code in PR #6234:
URL: https://github.com/apache/hadoop/pull/6234#discussion_r1375710840


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java:
##########
@@ -1849,8 +1849,8 @@ protected Subject getSubject() {
   @InterfaceStability.Evolving
   public <T> T doAs(PrivilegedAction<T> action) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("PrivilegedAction [as: {}][action: {}]", this, action,
-          new Exception());
+      LOG.debug("PrivilegedAction [as: {}][action: {}][from: {}]", this, 
action,
+              Thread.currentThread().getStackTrace()[2]);

Review Comment:
   Of course, having access to more stack information may be helpful for us in 
troubleshooting.
   But Before the HADOOP-16691  community’s approach was to adopt this way of 
print stack info.
   The excessive amount of information currently available is causing 
interference with troubleshooting assessment, and it requires us to make a 
trade-off.



##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java:
##########
@@ -1849,8 +1849,8 @@ protected Subject getSubject() {
   @InterfaceStability.Evolving
   public <T> T doAs(PrivilegedAction<T> action) {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("PrivilegedAction [as: {}][action: {}]", this, action,
-          new Exception());
+      LOG.debug("PrivilegedAction [as: {}][action: {}][from: {}]", this, 
action,
+              Thread.currentThread().getStackTrace()[2]);

Review Comment:
   Of course, having access to more stack information may be helpful for us in 
troubleshooting.
   But Before the HADOOP-16691  community’s approach was to adopt this way of 
print stack info.
   The excessive amount of information currently available is causing 
interference with troubleshooting assessment, and it requires us to make a 
trade-off.





> UserGroupInformation debug log improve
> --------------------------------------
>
>                 Key: HADOOP-18958
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18958
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: common
>    Affects Versions: 3.3.5, 3.3.3, 3.3.4
>            Reporter: wangzhihui
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 3.3.4
>
>         Attachments: 20231029-122825-1.jpeg, 20231029-122825.jpeg, 
> image-2023-10-29-09-47-56-489.png
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
>       Using “new Exception( )” to print the call stack of "doAs Method " in 
> the UserGroupInformation class. Using this way will print meaningless 
> Exception information and too many call stacks, This is not conducive to 
> troubleshooting
> *example:*
> !20231029-122825.jpeg|width=991,height=548!
>  
> *improved result* :
> !image-2023-10-29-09-47-56-489.png|width=1515,height=215!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to