Hean-Chhinling commented on code in PR #7726:
URL: https://github.com/apache/hadoop/pull/7726#discussion_r2143450213


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NMWebServices.java:
##########
@@ -271,6 +273,35 @@ public ContainerInfo 
getNodeContainer(@javax.ws.rs.core.Context
 
   }
 
+  @GET
+  @Path("/jstack")

Review Comment:
   Stack and JStack are totally different from each other. JStack is used on 
current running Java process to see what each thread are actually doing while 
Stack is just a list of active methods that have been called.
   
   Here is an example of JStack:
   
   ```
   2025-05-06 14:43:45
   Full thread dump OpenJDK 64-Bit Server VM (25.232-b09 mixed mode):
   
   "Attach Listener" #36 daemon prio=9 os_prio=0 tid=0x00007f8cf6288800 
nid=0x5601e waiting on condition [0x0000000000000000]
      java.lang.Thread.State: RUNNABLE
   
      Locked ownable synchronizers:
        - None
   
   "shuffle-client-4-1" #35 daemon prio=5 os_prio=0 tid=0x00007f8cd86e6800 
nid=0x55f04 runnable [0x00007f8ccfc0e000]
      java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
        at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
        at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
        - locked <0x00000000c1402a30> (a 
io.netty.channel.nio.SelectedSelectionKeySet)
        - locked <0x00000000c1402a48> (a java.util.Collections$UnmodifiableSet)
        - locked <0x00000000c14029e8> (a sun.nio.ch.EPollSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
        at 
   ```
   
   
   Here is an example Stack:
   
   
   ```
   Process Thread Dump: 
   263 active threads
   Thread 5938 (qtp2085713965-5938):
     State: RUNNABLE
     Blocked count: 2
     Waited count: 6
     Stack:
       sun.management.ThreadImpl.getThreadInfo1(Native Method)
       sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:178)
       sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:139)
       
org.apache.hadoop.util.ReflectionUtils.printThreadInfo(ReflectionUtils.java:169)
       
org.apache.hadoop.http.HttpServer2$StackServlet.doGet(HttpServer2.java:1563)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
       org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
       
org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656)
       
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:89)
       
com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:941)
       
com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:875)
       
org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebAppFilter.doFilter(RMWebAppFilter.java:178)
       
com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:829)
       
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
       
com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:119)
       com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133)
       com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130)
       com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203)
       com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130)
   Thread 5937 (qtp2085713965-5937):
   ```
   
   
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to