helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject [2/2] helix git commit: [HELIX-678] Clear controller event queue when it is shutdown or no longer the leader.
Date Wed, 14 Mar 2018 17:03:32 GMT
[HELIX-678] Clear controller event queue when it is shutdown or no longer the leader.

This change can prevent unnecessary event processing.


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/7e011d35
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/7e011d35
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/7e011d35

Branch: refs/heads/master
Commit: 7e011d358b10528dfa79362965e192012ffa4d22
Parents: b6fd8cb
Author: Jiajun Wang <jjwang@linkedin.com>
Authored: Mon Feb 5 13:29:59 2018 -0800
Committer: jiajunwang <ericwang1985@gmail.com>
Committed: Tue Mar 13 15:57:07 2018 -0700

----------------------------------------------------------------------
 .../org/apache/helix/controller/GenericHelixController.java     | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/7e011d35/helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
b/helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
index 933aa3e..8109a10 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
@@ -607,6 +607,8 @@ public class GenericHelixController implements IdealStateChangeListener,
       enableClusterStatusMonitor(true);
       _clusterStatusMonitor.setEnabled(!_paused);
     } else {
+      _eventQueue.clear();
+      _taskEventQueue.clear();
       enableClusterStatusMonitor(false);
     }
 
@@ -695,6 +697,9 @@ public class GenericHelixController implements IdealStateChangeListener,
     terminateEventThread(_eventThread);
     terminateEventThread(_taskEventThread);
 
+    _eventQueue.clear();
+    _taskEventQueue.clear();
+
     // shutdown asycTasksThreadpool and wait for terminate.
     _asyncTasksThreadPool.shutdownNow();
     try {


Mime
View raw message