HADOOP-16126. ipc.Client.stop() may sleep too long to wait for all connections.
This commit is contained in:
parent
95372657fc
commit
0edb0c51dc
|
@ -86,6 +86,7 @@ import static org.apache.hadoop.ipc.RpcConstants.PING_CALL_ID;
|
||||||
public class Client implements AutoCloseable {
|
public class Client implements AutoCloseable {
|
||||||
|
|
||||||
public static final Logger LOG = LoggerFactory.getLogger(Client.class);
|
public static final Logger LOG = LoggerFactory.getLogger(Client.class);
|
||||||
|
private static final int STOP_SLEEP_TIME_MS = 10;
|
||||||
|
|
||||||
/** A counter for generating call IDs. */
|
/** A counter for generating call IDs. */
|
||||||
private static final AtomicInteger callIdCounter = new AtomicInteger();
|
private static final AtomicInteger callIdCounter = new AtomicInteger();
|
||||||
|
@ -1353,7 +1354,7 @@ public class Client implements AutoCloseable {
|
||||||
// wait until all connections are closed
|
// wait until all connections are closed
|
||||||
while (!connections.isEmpty()) {
|
while (!connections.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(STOP_SLEEP_TIME_MS);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue