You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2019/04/16 20:23:53 UTC

[incubator-pinot] branch race_condition created (now 61c497d)

This is an automated email from the ASF dual-hosted git repository.

jackie pushed a change to branch race_condition
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at 61c497d  In ClusterChangeMediator, add stop flag check inside for loop and wait block

This branch includes the following new commits:

     new 61c497d  In ClusterChangeMediator, add stop flag check inside for loop and wait block

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[incubator-pinot] 01/01: In ClusterChangeMediator, add stop flag check inside for loop and wait block

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch race_condition
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 61c497d2766223fc21b84c58becd6ce86a7c1dff
Author: Jackie (Xiaotian) Jiang <xa...@linkedin.com>
AuthorDate: Tue Apr 16 13:20:29 2019 -0700

    In ClusterChangeMediator, add stop flag check inside for loop and wait block
    
    1. Add stop flag check inside for loop to not wait until all change types getting processed
    2. Add stop flag check into wait block to prevent thread wait without notify() called
---
 .../apache/pinot/broker/broker/helix/ClusterChangeMediator.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/ClusterChangeMediator.java b/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/ClusterChangeMediator.java
index 25d5ff2..64b2a1e 100644
--- a/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/ClusterChangeMediator.java
+++ b/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/ClusterChangeMediator.java
@@ -77,9 +77,12 @@ public class ClusterChangeMediator implements ExternalViewChangeListener, Instan
     _clusterChangeHandlingThread = new Thread("ClusterChangeHandlingThread") {
       @Override
       public void run() {
-        while (!_stopped) {
+        while (true) {
           try {
             for (Map.Entry<ChangeType, List<ClusterChangeHandler>> entry : _changeHandlersMap.entrySet()) {
+              if (_stopped) {
+                return;
+              }
               ChangeType changeType = entry.getKey();
               List<ClusterChangeHandler> changeHandlers = entry.getValue();
               long currentTime = System.currentTimeMillis();
@@ -101,6 +104,9 @@ public class ClusterChangeMediator implements ExternalViewChangeListener, Instan
               }
             }
             synchronized (_lastChangeTimeMap) {
+              if (_stopped) {
+                return;
+              }
               // Wait for at most 1/10 of proactive change check interval if no new event received. This can guarantee
               // that the proactive change check will not be delayed for more than 1/10 of the interval. In case of
               // spurious wakeup, execute the while loop again for the proactive change check.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org