-
Notifications
You must be signed in to change notification settings - Fork 9k
YARN-11823: add new endpoints for getting jstacks of application and nodes #7726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
8ec513c
to
80814ff
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@@ -271,6 +273,35 @@ public ContainerInfo getNodeContainer(@javax.ws.rs.core.Context | |||
|
|||
} | |||
|
|||
@GET | |||
@Path("/jstack") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be a bit misleading name cause we already have a /stacks API for jstack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also how those it different from /stacks ?
public Response getNodeJStack() { | ||
try { | ||
return Response.status(Status.OK) | ||
.entity(DiagnosticJStackService.collectNodeJStack()) // Make sure the NodeManager have python3 install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will happen if py3 is not present?
private static final String PYTHON_COMMAND = "python3"; | ||
private static String scriptLocation = null; | ||
|
||
static { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This static block will block the NM to start up, till it is not done
} | ||
} | ||
|
||
public static String collectNodeJStack() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First i read NodeJS, can we use other name here?
|
||
protected static ProcessBuilder createProcessBuilder() { | ||
List<String> commandList = | ||
new ArrayList<>(Arrays.asList(PYTHON_COMMAND, scriptLocation)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need ArrayList?
|
||
NUMBER_OF_JSTACK = 3 | ||
|
||
def get_nodemanager_pid(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I beleive from security perspective, these should not be available in REST API in case of not secure cluster, and we should do authorisation in secured clusters.
import subprocess | ||
import sys | ||
|
||
NUMBER_OF_JSTACK = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be path throw REST
@@ -271,6 +273,35 @@ public ContainerInfo getNodeContainer(@javax.ws.rs.core.Context | |||
|
|||
} | |||
|
|||
@GET | |||
@Path("/jstack") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also how those it different from /stacks ?
💔 -1 overall
This message was automatically generated. |
Description of PR
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?