hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r570204 - in /lucene/hadoop/trunk: CHANGES.txt conf/hadoop-default.xml src/java/org/apache/hadoop/mapred/TaskRunner.java src/java/org/apache/hadoop/mapred/TaskTracker.java
Date Mon, 27 Aug 2007 17:58:36 GMT
Author: cutting
Date: Mon Aug 27 10:58:35 2007
New Revision: 570204

URL: http://svn.apache.org/viewvc?rev=570204&view=rev
Log:
HADOOP-1739.  Fix task tracker report server to use a port selected by the operating system.
 Contributed by Arun.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/conf/hadoop-default.xml
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=570204&r1=570203&r2=570204&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Mon Aug 27 10:58:35 2007
@@ -113,6 +113,11 @@
     HADOOP-1740.  Fix null pointer exception in sorting map outputs. (Devaraj
     Das via omalley)
 
+    HADOOP-1739.  Fix task tracker report server to use a port
+    selected by the operating system by default rather than specifying
+    a port, which can fail when that port is not free.
+    (Arun C Murthy via cutting)
+
 
 Release 0.14.0 - 2007-08-17
 

Modified: lucene/hadoop/trunk/conf/hadoop-default.xml
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/conf/hadoop-default.xml?rev=570204&r1=570203&r2=570204&view=diff
==============================================================================
--- lucene/hadoop/trunk/conf/hadoop-default.xml (original)
+++ lucene/hadoop/trunk/conf/hadoop-default.xml Mon Aug 27 10:58:35 2007
@@ -476,9 +476,9 @@
 
 <property>
   <name>mapred.task.tracker.report.port</name>
-  <value>50050</value>
-  <description>The port number that the MapReduce task tracker report server uses as
a starting
-               point to look for a free port to listen on.
+  <value>0</value>
+  <description>The port number that the MapReduce task tracker report server uses.
+  By default we set it to zero to let the operating system pick an ephemeral port.
   </description>
 </property>
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java?rev=570204&r1=570203&r2=570204&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java Mon Aug 27 10:58:35
2007
@@ -243,7 +243,7 @@
                                                    conf.get("mapred.child.java.opts", "-Xmx200m"),
                                                    conf.get("mapred.child.heap.size"));
         javaOpts = replaceAll(javaOpts, "@taskid@", taskid);
-        int port = conf.getInt("mapred.task.tracker.report.port", 50050) + 1;
+        int port = tracker.getTaskTrackerReportPort() + 1;
         javaOpts = replaceAll(javaOpts, "@port@", Integer.toString(port));
         String [] javaOptsSplit = javaOpts.split(" ");
         //Add java.library.path; necessary for native-hadoop libraries

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=570204&r1=570203&r2=570204&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Mon Aug 27 10:58:35
2007
@@ -407,22 +407,17 @@
     this.myMetrics = new TaskTrackerMetrics();
     
     // port numbers
-    this.taskReportPort = this.fConf.getInt("mapred.task.tracker.report.port", 50050);
+    this.taskReportPort = this.fConf.getInt("mapred.task.tracker.report.port", 0);
     // bind address
-    this.taskReportBindAddress = this.fConf.get("mapred.task.tracker.report.bindAddress",
"0.0.0.0");
+    this.taskReportBindAddress = this.fConf.get("mapred.task.tracker.report.bindAddress",

+                                                "0.0.0.0");
 
     // RPC initialization
-    while (true) {
-      try {
-        this.taskReportServer = RPC.getServer(this, this.taskReportBindAddress, this.taskReportPort,
maxCurrentTasks, false, this.fConf);
-        this.taskReportServer.start();
-        break;
-      } catch (BindException e) {
-        LOG.info("Could not open report server at " + this.taskReportPort + ", trying new
port");
-        this.taskReportPort++;
-      }
+    this.taskReportServer = RPC.getServer(this, this.taskReportBindAddress, 
+                                          this.taskReportPort, maxCurrentTasks, 
+                                          false, this.fConf);
+    this.taskReportServer.start();
         
-    }
     // The rpc-server port can be ephemeral... 
     // ... ensure we have the correct info
     this.taskReportPort = taskReportServer.getListenerAddress().getPort();



Mime
View raw message