Skip to content
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

TEZ-4566: NPE in TezChild while fetching attemptId when container is asked to shut down #358

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ protected ContainerTask callInternal() throws Exception {
+ " ms after starting to poll."
+ " TaskInfo: shouldDie: "
+ containerTask.shouldDie()
+ (containerTask.shouldDie() == true ? "" : ", currentTaskAttemptId: "
+ containerTask.getTaskSpec().getTaskAttemptID()));
+ (containerTask.shouldDie() ? "" : ", currentTaskAttemptId: "
+ (containerTask.getTaskSpec() == null ? "none"
: containerTask.getTaskSpec().getTaskAttemptID())));
return containerTask;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,28 +249,27 @@ public ContainerExecutionResult run() throws IOException, InterruptedException,
}
}

TezTaskAttemptID attemptId = containerTask.getTaskSpec().getTaskAttemptID();
Configuration taskConf;
if (containerTask.getTaskSpec().getTaskConf() != null) {
Configuration copy = new Configuration(defaultConf);
TezTaskRunner2.mergeTaskSpecConfToConf(containerTask.getTaskSpec(), copy);
taskConf = copy;
LoggingUtils.initLoggingContext(mdcContext, copy,
attemptId.getTaskID().getVertexID().getDAGID().toString(), attemptId.toString());
} else {
taskConf = defaultConf;
LoggingUtils.initLoggingContext(mdcContext, defaultConf,
attemptId.getTaskID().getVertexID().getDAGID().toString(), attemptId.toString());
}

TezCommonUtils.logCredentials(LOG, containerTask.getCredentials(), "containerTask");
if (containerTask.shouldDie()) {
LOG.info("ContainerTask returned shouldDie=true for container {}, Exiting", containerIdString);
shutdown();
return new ContainerExecutionResult(ContainerExecutionResult.ExitStatus.SUCCESS, null,
"Asked to die by the AM");
} else {
String loggerAddend = containerTask.getTaskSpec().getTaskAttemptID().toString();
TezTaskAttemptID attemptId = containerTask.getTaskSpec().getTaskAttemptID();
Configuration taskConf;
if (containerTask.getTaskSpec().getTaskConf() != null) {
Configuration copy = new Configuration(defaultConf);
TezTaskRunner2.mergeTaskSpecConfToConf(containerTask.getTaskSpec(), copy);
taskConf = copy;
LoggingUtils.initLoggingContext(mdcContext, copy, attemptId.getTaskID().getVertexID().getDAGID().toString(),
attemptId.toString());
} else {
taskConf = defaultConf;
LoggingUtils.initLoggingContext(mdcContext, defaultConf,
attemptId.getTaskID().getVertexID().getDAGID().toString(), attemptId.toString());
}
String loggerAddend = attemptId.toString();
taskCount++;
String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
System.err.println(timeStamp + " Starting to run new task attempt: " +
Expand Down
Loading