You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by bh...@apache.org on 2019/04/05 17:42:09 UTC
[hadoop] branch trunk updated: HDDS-1389. Fix
testSCMChillModeRestrictedOp. (#696)
This is an automated email from the ASF dual-hosted git repository.
bharat pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 5750bb9 HDDS-1389. Fix testSCMChillModeRestrictedOp. (#696)
5750bb9 is described below
commit 5750bb94edc98436723975e2f84c38f513e59bef
Author: Nanda kumar <na...@gmail.com>
AuthorDate: Fri Apr 5 23:12:00 2019 +0530
HDDS-1389. Fix testSCMChillModeRestrictedOp. (#696)
---
.../hdds/scm/chillmode/ChillModeHandler.java | 27 ++++++++++++++--------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/chillmode/ChillModeHandler.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/chillmode/ChillModeHandler.java
index fff1fb2..ae41821 100644
--- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/chillmode/ChillModeHandler.java
+++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/chillmode/ChillModeHandler.java
@@ -88,16 +88,25 @@ public class ChillModeHandler implements EventHandler<ChillModeStatus> {
@Override
public void onMessage(ChillModeStatus chillModeStatus,
EventPublisher publisher) {
- try {
- isInChillMode.set(chillModeStatus.getChillModeStatus());
- scmClientProtocolServer.setChillModeStatus(isInChillMode.get());
- scmBlockManager.setChillModeStatus(isInChillMode.get());
- Thread.sleep(waitTime);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- } finally {
- replicationManager.start();
+
+ isInChillMode.set(chillModeStatus.getChillModeStatus());
+ scmClientProtocolServer.setChillModeStatus(isInChillMode.get());
+ scmBlockManager.setChillModeStatus(isInChillMode.get());
+
+ if (!isInChillMode.get()) {
+ final Thread chillModeExitThread = new Thread(() -> {
+ try {
+ Thread.sleep(waitTime);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ replicationManager.start();
+ });
+
+ chillModeExitThread.setDaemon(true);
+ chillModeExitThread.start();
}
+
}
public boolean getChillModeStatus() {
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org