kaisun2000 commented on a change in pull request #1295:
URL: https://github.com/apache/helix/pull/1295#discussion_r474872812
##########
File path:
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -2156,6 +2160,21 @@ public void connect(final long
maxMsToWaitUntilConnected, Watcher watcher)
LOG.debug("ZkClient created with _uid {}, _eventThread {}", _uid,
_eventThread.getId());
+ // initiate monitor
+ try {
+ if (_monitorKey != null && !_monitorKey.isEmpty() && _monitorType !=
null && !_monitorType
+ .isEmpty()) {
+ _monitor =
+ new ZkClientMonitor(_monitorType, _monitorKey,
_monitorInstanceName, _monitorRootPathOnly,
Review comment:
Basically, currently code has a race condition. The event of _monitor
construction and _monitor first event recording sequence are not deterministic.
_monitor construction is in main thread which construct szkclient while
statechangecount in _monitor is increased in zookeeper client event thread by
calling process() of zkclient.
See the description of the issue #1294 for more info.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]