HADOOP-6428. HttpServer sleeps with negative values. Contributed by Konstantin Boudnik

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@889378 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Konstantin Boudnik 2009-12-10 19:26:07 +00:00
parent a473f37733
commit d7fb2d3c85
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -474,14 +474,13 @@ public class HttpServer implements FilterContainer {
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();