Author: acmurthy
Date: Mon May 2 23:42:27 2011
New Revision: 1098863
URL: http://svn.apache.org/viewvc?rev=1098863&view=rev
Log:
HADOOP-6386. NameNode's HttpServer can't instantiate InetSocketAddress:
IllegalArgumentException is thrown. (cos)
Modified:
hadoop/common/branches/branch-0.20-security-203/CHANGES.txt
hadoop/common/branches/branch-0.20-security-203/src/core/org/apache/hadoop/http/HttpServer.java
Modified: hadoop/common/branches/branch-0.20-security-203/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-203/CHANGES.txt?rev=1098863&r1=1098862&r2=1098863&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-203/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security-203/CHANGES.txt Mon May 2
23:42:27 2011
@@ -1717,6 +1717,9 @@ Release 0.20.2 - Unreleased
HADOOP-6269. Fix threading issue with defaultResource in Configuration.
(Sreekanth Ramakrishnan via cdouglas)
+ HADOOP-6386. NameNode's HttpServer can't instantiate InetSocketAddress:
+ IllegalArgumentException is thrown. (cos)
+
Release 0.20.1 - 2009-09-01
INCOMPATIBLE CHANGES
Modified:
hadoop/common/branches/branch-0.20-security-203/src/core/org/apache/hadoop/http/HttpServer.java
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-203/src/core/org/apache/hadoop/http/HttpServer.java?rev=1098863&r1=1098862&r2=1098863&view=diff
==============================================================================
---
hadoop/common/branches/branch-0.20-security-203/src/core/org/apache/hadoop/http/HttpServer.java
(original)
+++
hadoop/common/branches/branch-0.20-security-203/src/core/org/apache/hadoop/http/HttpServer.java
Mon May 2 23:42:27 2011
@@ -596,6 +596,33 @@ public class HttpServer implements Filte
} //Workaround end
LOG.info("Jetty bound to port " + port);
webServer.start();
+ // Workaround for HADOOP-6386
+ if (port < 0) {
+ Random r = new Random(1000);
+ for (int i = 0; i < MAX_RETRIES/2; i++) {
+ try {
+ webServer.stop();
+ } catch (Exception e) {
+ LOG.warn("Can't stop web-server", e);
+ }
+ LOG.info("Bouncing the listener");
+ listener.close();
+ Thread.sleep(r.nextInt());
+ listener.setPort(oriPort == 0 ? 0 : (oriPort += 1));
+ listener.open();
+ Thread.sleep(100);
+
+ webServer.start();
+ Thread.sleep(r.nextInt());
+ port = listener.getLocalPort();
+ if (port > 0)
+ break;
+ }
+ if (port < 0)
+ throw new BindException("listener.getLocalPort() is returning
" +
+ "less than 0 even after " +MAX_RETRIES+"
resets");
+ }
+ // End of HADOOP-6386 workaround
break;
} catch (IOException ex) {
// if this is a bind exception,