kaisun2000 commented on a change in pull request #363: Fix the race condition while Helix refresh cluster status cache. URL: https://github.com/apache/helix/pull/363#discussion_r308489309
########## File path: helix-core/src/main/java/org/apache/helix/controller/dataproviders/BaseControllerDataProvider.java ########## @@ -82,7 +84,7 @@ private ExecutorService _asyncTasksThreadPool; // A map recording what data has changed - protected Map<HelixConstants.ChangeType, Boolean> _propertyDataChangedMap; + protected Map<HelixConstants.ChangeType, AtomicBoolean> _propertyDataChangedMap; Review comment: I think the atomicBoolean here is not essential. To fix this bug, we don't really need atomicBoolean. It is essential to use a concurrentHashMap as notifyDataChange() will update value in this map to true in an async way. Value changed in ConcurrentHashMap is considered as safe publication anyway. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services