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

[GOBBLIN-503] ForkThrowableHolder has wrong condition check #2373

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public ForkException getAggregatedException (List<Integer> failedForkIds, String
for (Integer idx: failedForkIds) {
stringBuffer.append("<Fork " + idx + ">\n");
if (this.throwables.containsKey(idx)) {
stringBuffer.append("Cannot find throwable entry in ForkThrowableHolder\n");
} else {
stringBuffer.append(ExceptionUtils.getFullStackTrace(this.throwables.get(idx)));
} else {
stringBuffer.append("Cannot find throwable entry in ForkThrowableHolder\n");
}
}
return new ForkException(stringBuffer.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ public void commit() {
}
} else {
ForkThrowableHolder holder = Task.getForkThrowableHolder(this.taskState.getTaskBroker());
LOG.info("Holder for this task {} is {}", this.taskId, holder);
if (!holder.isEmpty()) {
failTask(holder.getAggregatedException(failedForkIds, this.taskId));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,11 @@ public void run() {
processRecords();
compareAndSetForkState(ForkState.RUNNING, ForkState.SUCCEEDED);
} catch (Throwable t) {
this.forkState.set(ForkState.FAILED);
this.logger.error(String.format("Fork %d of task %s failed to process data records", this.index, this.taskId), t);
// Set throwable to holder first because AsynchronousFork::putRecord can pull the throwable when it detects ForkState.FAILED status.
ForkThrowableHolder holder = Task.getForkThrowableHolder(this.broker);
holder.setThrowable(this.getIndex(), t);
this.forkState.set(ForkState.FAILED);
this.logger.error(String.format("Fork %d of task %s failed to process data records. Set throwable in holder %s", this.index, this.taskId, holder), t);
} finally {
this.cleanup();
}
Expand Down