diff --git a/mapreduce/CHANGES.txt b/mapreduce/CHANGES.txt index 3d798db9be..3d3d9b8453 100644 --- a/mapreduce/CHANGES.txt +++ b/mapreduce/CHANGES.txt @@ -212,6 +212,9 @@ Trunk (unreleased changes) MAPREDUCE-2705. Permits parallel multiple task launches. (Thomas Graves via ddas) + MAPREDUCE-2489. Jobsplits with random hostnames can make the queue + unusable (jeffrey naisbit via mahadev) + OPTIMIZATIONS MAPREDUCE-2026. Make JobTracker.getJobCounters() and diff --git a/mapreduce/src/java/org/apache/hadoop/mapred/JobInProgress.java b/mapreduce/src/java/org/apache/hadoop/mapred/JobInProgress.java index 429d2b0153..51b3329284 100644 --- a/mapreduce/src/java/org/apache/hadoop/mapred/JobInProgress.java +++ b/mapreduce/src/java/org/apache/hadoop/mapred/JobInProgress.java @@ -20,6 +20,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.net.UnknownHostException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Collection; @@ -622,7 +623,7 @@ void setNumSlotsPerReduce(int numSlotsPerReduce) { * at {@link JobTracker#initJob(JobInProgress)} for more details. */ public synchronized void initTasks() - throws IOException, KillInterruptedException { + throws IOException, KillInterruptedException, UnknownHostException { if (tasksInited.get() || isComplete()) { return; } @@ -653,6 +654,11 @@ public synchronized void initTasks() checkTaskLimits(); + // Sanity check the locations so we don't create/initialize unnecessary tasks + for (TaskSplitMetaInfo split : taskSplitMetaInfo) { + NetUtils.verifyHostnames(split.getLocations()); + } + jobtracker.getInstrumentation().addWaitingMaps(getJobID(), numMapTasks); jobtracker.getInstrumentation().addWaitingReduces(getJobID(), numReduceTasks); diff --git a/mapreduce/src/java/org/apache/hadoop/mapred/JobTracker.java b/mapreduce/src/java/org/apache/hadoop/mapred/JobTracker.java index 6e6d973557..979a030d38 100644 --- a/mapreduce/src/java/org/apache/hadoop/mapred/JobTracker.java +++ b/mapreduce/src/java/org/apache/hadoop/mapred/JobTracker.java @@ -2778,7 +2778,8 @@ private void updateNodeHealthStatus(TaskTrackerStatus trackerStatus) { */ synchronized boolean processHeartbeat( TaskTrackerStatus trackerStatus, - boolean initialContact) { + boolean initialContact) + throws UnknownHostException { getInstrumentation().heartbeat();