Skip to content
Open
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 @@ -369,8 +369,9 @@ private long speculationValue(Task task, long now, boolean shouldUseTimeout) {
return TOO_NEW;
}

long taskRuntime = now - taskAttemptStartTime;
if (shouldUseTimeout) {
if ((now - taskAttemptStartTime) > taskTimeout) {
if (taskRuntime > taskTimeout) {
// If the task has timed out, then we want to schedule a speculation
// immediately. However we cannot return immediately since we may
// already have a speculation running.
Expand All @@ -380,6 +381,10 @@ private long speculationValue(Task task, long now, boolean shouldUseTimeout) {
return ON_SCHEDULE;
}
} else {
if (taskRuntime < acceptableRuntime) {
return ON_SCHEDULE;
}

long estimatedRunTime = estimator
.estimatedRuntime(runningTaskAttemptID);

Expand Down