@@ -249,28 +249,27 @@ public ContainerExecutionResult run() throws IOException, InterruptedException,
249249 }
250250 }
251251
252- TezTaskAttemptID attemptId = containerTask .getTaskSpec ().getTaskAttemptID ();
253- Configuration taskConf ;
254- if (containerTask .getTaskSpec ().getTaskConf () != null ) {
255- Configuration copy = new Configuration (defaultConf );
256- TezTaskRunner2 .mergeTaskSpecConfToConf (containerTask .getTaskSpec (), copy );
257- taskConf = copy ;
258- LoggingUtils .initLoggingContext (mdcContext , copy ,
259- attemptId .getTaskID ().getVertexID ().getDAGID ().toString (), attemptId .toString ());
260- } else {
261- taskConf = defaultConf ;
262- LoggingUtils .initLoggingContext (mdcContext , defaultConf ,
263- attemptId .getTaskID ().getVertexID ().getDAGID ().toString (), attemptId .toString ());
264- }
265-
266252 TezCommonUtils .logCredentials (LOG , containerTask .getCredentials (), "containerTask" );
267253 if (containerTask .shouldDie ()) {
268254 LOG .info ("ContainerTask returned shouldDie=true for container {}, Exiting" , containerIdString );
269255 shutdown ();
270256 return new ContainerExecutionResult (ContainerExecutionResult .ExitStatus .SUCCESS , null ,
271257 "Asked to die by the AM" );
272258 } else {
273- String loggerAddend = containerTask .getTaskSpec ().getTaskAttemptID ().toString ();
259+ TezTaskAttemptID attemptId = containerTask .getTaskSpec ().getTaskAttemptID ();
260+ Configuration taskConf ;
261+ if (containerTask .getTaskSpec ().getTaskConf () != null ) {
262+ Configuration copy = new Configuration (defaultConf );
263+ TezTaskRunner2 .mergeTaskSpecConfToConf (containerTask .getTaskSpec (), copy );
264+ taskConf = copy ;
265+ LoggingUtils .initLoggingContext (mdcContext , copy , attemptId .getTaskID ().getVertexID ().getDAGID ().toString (),
266+ attemptId .toString ());
267+ } else {
268+ taskConf = defaultConf ;
269+ LoggingUtils .initLoggingContext (mdcContext , defaultConf ,
270+ attemptId .getTaskID ().getVertexID ().getDAGID ().toString (), attemptId .toString ());
271+ }
272+ String loggerAddend = attemptId .toString ();
274273 taskCount ++;
275274 String timeStamp = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss" ).format (Calendar .getInstance ().getTime ());
276275 System .err .println (timeStamp + " Starting to run new task attempt: " +
0 commit comments