laxman-ch commented on code in PR #3052:
URL: https://github.com/apache/helix/pull/3052#discussion_r2192965726


##########
helix-core/src/main/java/org/apache/helix/participant/DistClusterControllerStateModel.java:
##########
@@ -62,7 +65,7 @@ public void onBecomeLeaderFromStandby(Message message, 
NotificationContext conte
 
     logger.info(controllerName + " becoming leader from standby for " + 
clusterName);
 
-    synchronized (_controllerOpt) {
+    synchronized (_controllerLock) {

Review Comment:
   @junkaixue : a new lock based implementation is close to the existing 
implementation while fixing the problem on the lock contention issue found as 
mentioned in the issue (due to JDK implementation of Optional.empty as 
singleton).
   
   imho, making the methods synchronized may be of larger scope as we need to 
relook at the thread safety of other instance variables in current class and 
its base classes. So, if you suggest to fix this, should this be addressed in a 
different issue and PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org

Reply via email to