HDFS-6461. Use Time#monotonicNow to compute duration in DataNode#shutDown. Contributed by James Thomas.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1598399 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4a4868e523
commit
1d5e564998
@ -607,6 +607,9 @@ Release 2.5.0 - UNRELEASED
|
|||||||
HDFS-6453. Use Time#monotonicNow to avoid system clock reset.
|
HDFS-6453. Use Time#monotonicNow to avoid system clock reset.
|
||||||
(Liang Xie via wang)
|
(Liang Xie via wang)
|
||||||
|
|
||||||
|
HDFS-6461. Use Time#monotonicNow to compute duration in DataNode#shutDown.
|
||||||
|
(James Thomas via wang)
|
||||||
|
|
||||||
Release 2.4.1 - UNRELEASED
|
Release 2.4.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -1221,7 +1221,7 @@ public void shutdown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Record the time of initial notification
|
// Record the time of initial notification
|
||||||
long timeNotified = Time.now();
|
long timeNotified = Time.monotonicNow();
|
||||||
|
|
||||||
if (localDataXceiverServer != null) {
|
if (localDataXceiverServer != null) {
|
||||||
((DataXceiverServer) this.localDataXceiverServer.getRunnable()).kill();
|
((DataXceiverServer) this.localDataXceiverServer.getRunnable()).kill();
|
||||||
@ -1253,8 +1253,9 @@ public void shutdown() {
|
|||||||
while (true) {
|
while (true) {
|
||||||
// When shutting down for restart, wait 2.5 seconds before forcing
|
// When shutting down for restart, wait 2.5 seconds before forcing
|
||||||
// termination of receiver threads.
|
// termination of receiver threads.
|
||||||
if (!this.shutdownForUpgrade ||
|
if (!this.shutdownForUpgrade ||
|
||||||
(this.shutdownForUpgrade && (Time.now() - timeNotified > 2500))) {
|
(this.shutdownForUpgrade && (Time.monotonicNow() - timeNotified
|
||||||
|
> 2500))) {
|
||||||
this.threadGroup.interrupt();
|
this.threadGroup.interrupt();
|
||||||
}
|
}
|
||||||
LOG.info("Waiting for threadgroup to exit, active threads is " +
|
LOG.info("Waiting for threadgroup to exit, active threads is " +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user