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
[FLINK-1179] Add button to JobManager web interface to request stack trace of a TaskManager #374
Conversation
@@ -349,6 +349,11 @@ Actor with ActorLogMessages with ActorLogging { | |||
case Heartbeat(instanceID) => | |||
instanceManager.reportHeartBeat(instanceID) | |||
|
|||
case RequestStackTrace(instanceID) => | |||
val taskManager = instanceManager.getRegisteredInstanceById(instanceID).getTaskManager | |||
val result = AkkaUtils.ask[StackTrace](taskManager, SendStackTrace) |
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 is a blocking call within the actor thread. We should avoid this. You can simply forward the SendStackTrace
message to the respective TaskManager: taskManager forward SendStacktrace
Hi Chiwan, thanks for your work. It looks really good. I had some just some minor remarks. |
@tillrohrmann Thanks for your advice. I will fix it! |
423e64c
to
9b7ddb9
Compare
Very nice work. I have one comment inline, otherwise +1 to go! |
PrintWriter w = resp.getWriter(); | ||
w.write(obj.toString()); | ||
} | ||
|
||
|
||
private void writeStackTraceOfTaskManager(String instanceIdStr, HttpServletResponse resp) throws IOException { |
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.
The RequestStackTrace
message may fail, if the task manager is not reachable.
I suggest to surround this block with try / catch(Throwable) and forward the error message to the web client.
The response JSON may then have two fields: "errorMessage" and "stackTrace". If "errorMessage" is defined, display the message, otherwise print the stack trace.
I've tried it out locally. Looks very nice. Thank you. +1 to merge. |
…equest stack trace of a TaskManager
9b7ddb9
to
bd32273
Compare
@StephanEwen Thanks for your advice! I fixed it. |
Looks good. There is a small conflict with #384 , but we can try and fix this while merging. +1 |
I'll probably merge this change tomorrow because I'm working on a bigger change on the web frontend. |
.... Merging this now ... https://github.com/rmetzger/flink/compare/FLINK-1179 |
…equest stack trace of a TaskManager This closes apache#374
…equest stack trace of a TaskManager This closes apache#374
…equest stack trace of a TaskManager This closes apache#374
This PR contains following changes:
org.apache.flink.runtime.instance.InstanceID
for sending instance ID from web interface to job managergetRegisteredInstanceById(InstanceID)
intoorg.apache.flink.runtime.instance.InstanceManager
for finding Akka Actor from instance IDRequestStackTrace
,SendStackTrace
andStackTrace
The following image is a screenshot of web interface of job manager.