diff --git a/CHANGES.txt b/CHANGES.txt index f0ea538a5a..0af1a137ec 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -71,6 +71,8 @@ Trunk (unreleased changes) 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 diff --git a/src/java/org/apache/hadoop/http/HttpServer.java b/src/java/org/apache/hadoop/http/HttpServer.java index 39dc350515..0257141b8e 100644 --- a/src/java/org/apache/hadoop/http/HttpServer.java +++ b/src/java/org/apache/hadoop/http/HttpServer.java @@ -474,14 +474,13 @@ public void start() throws IOException { 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();