TEZ-4605: Enable hadoop CallerContext in TezChild and DAGAppMaster#394
TEZ-4605: Enable hadoop CallerContext in TezChild and DAGAppMaster#394ayushtkn merged 6 commits intoapache:masterfrom
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.
This will overwrite any existing CallerContext, You need to append the values not overwrite
There was a problem hiding this comment.
Thanks for you review,@ayushtkn
I just fixed this line, is it OK now?
There was a problem hiding this comment.
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.
if any code or application which invokes the DagAppMaster sets it then?
There was a problem hiding this comment.
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.
Ahh, then we can live without it.
is there a possibility to extend some tests?
There was a problem hiding this comment.
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. |
|
💔 -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:
