Author: cos Date: Thu Dec 10 19:26:07 2009 New Revision: 889378 URL: http://svn.apache.org/viewvc?rev=889378&view=rev Log: HADOOP-6428. HttpServer sleeps with negative values. Contributed by Konstantin Boudnik
Modified: hadoop/common/trunk/CHANGES.txt hadoop/common/trunk/src/java/org/apache/hadoop/http/HttpServer.java Modified: hadoop/common/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=889378&r1=889377&r2=889378&view=diff ============================================================================== --- hadoop/common/trunk/CHANGES.txt (original) +++ hadoop/common/trunk/CHANGES.txt Thu Dec 10 19:26:07 2009 @@ -71,6 +71,8 @@ HADOOP-6254. Slow reads cause s3n to fail with SocketTimeoutException. (Andrew Hitchcock via tomwhite) + HADOOP-6428. HttpServer sleeps with negative values. (cos) + Release 0.21.0 - Unreleased INCOMPATIBLE CHANGES Modified: hadoop/common/trunk/src/java/org/apache/hadoop/http/HttpServer.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/http/HttpServer.java?rev=889378&r1=889377&r2=889378&view=diff ============================================================================== --- hadoop/common/trunk/src/java/org/apache/hadoop/http/HttpServer.java (original) +++ hadoop/common/trunk/src/java/org/apache/hadoop/http/HttpServer.java Thu Dec 10 19:26:07 2009 @@ -474,14 +474,13 @@ port = listener.getLocalPort(); if (port < 0) { LOG.warn("Bounds port is " + port + " after webserver start"); - 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); } - Thread.sleep(r.nextInt()); + Thread.sleep(1000); listener.setPort(oriPort == 0 ? 0 : (oriPort += 1)); listener.open();