-
Notifications
You must be signed in to change notification settings - Fork 440
TEZ-4605: Enable hadoop CallerContext in TezChild and DAGAppMaster #394
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
Conversation
|
@tez-yetus @abstractdog |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
| org.apache.hadoop.ipc.CallerContext.setCurrent(new org.apache.hadoop.ipc.CallerContext | ||
| .Builder("tez_appmaster_" + containerId.getApplicationAttemptId() | ||
| ).build()); |
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 will overwrite any existing CallerContext, You need to append the values not overwrite
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.
Thanks for you review,@ayushtkn
I just fixed this line, is it OK now?
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 will overwrite any existing
CallerContext, You need to append the values not overwrite
But in my opinion, this org.apache.hadoop.ipc.CallerContextis different from org.apache.tez.client.CallerContext, in this main function, it is the first time I set a new value to org.apache.hadoop.ipc.CallerContext, so there will be no existing CallerContext.
is it correct?
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.
if any code or application which invokes the DagAppMaster sets it then?
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.
org.apache.hadoop.ipc.CallerContext is a threadLocal variable, if other application invokes the DagAppMaster, it should start a new thread, and create a new callercontext variable.
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.
Ahh, then we can live without it.
is there a possibility to extend some tests?
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 tried to implement some unit tests, but the ThreadLocal variable could not be accessed. In Hadoop, this ThreadLocal variable is tested by checking the audit log, but I am unable to start a Hadoop Mini Cluster and correctly invoke DAGAppMaster, so I cannot implement this unit test.
However, the code implementation is simple, and there is a similar implementation in this Hadoop pr which is implemented by my coworker, so it should definitely work.
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
ayushtkn
left a comment
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.
LGTM
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
As described in TEZ-4605
What did I change
I modified
tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.javaandtez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.javaWhy did I change
I want to enable org.apache.hadoop.ipc.CallerContext when running TEZ on yarn, so that we can trace how the application interacted with hdfs files.
How did I test
I modified the code and build the whole project, then I test on my own hadoop cluster, we can see the callcontext information in hdfs-audit.log.
here is a screenshot of it:
