jiajunwang commented on a change in pull request #924: Fix ZkHelixPropertyStore
loses Zookeeper notification issue
URL: https://github.com/apache/helix/pull/924#discussion_r406001302
##########
File path:
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -1080,22 +1080,21 @@ protected void processStateChanged(WatchedEvent event)
{
*/
if (event.getState() == KeeperState.SyncConnected) {
if (!_isNewSessionEventFired && !"0".equals(getHexSessionId())) {
- if (isManagingZkConnection()) {
- /*
- * Before the new zookeeper instance is connected to the zookeeper
service and its session
- * is established, its session id is 0.
- * New session event is not fired until the new zookeeper session
receives the first
- * SyncConnected state(the zookeeper session is established).
- * Now the session id is available and non-zero, and we can fire new
session events.
- */
- fireNewSessionEvents();
- }
/*
* Set it true to avoid firing events again for the same session next
time
* when SyncConnected events are received.
*/
_isNewSessionEventFired = true;
+ /*
+ * Before the new zookeeper instance is connected to the zookeeper
service and its session
+ * is established, its session id is 0.
+ * New session event is not fired until the new zookeeper session
receives the first
+ * SyncConnected state(the zookeeper session is established).
+ * Now the session id is available and non-zero, and we can fire new
session events.
+ */
+ fireNewSessionEvents();
Review comment:
Thanks for put the check inside the function. But why we need to move it to
after _isNewSessionEventFired = true;?
Is it concerning? Because when _isNewSessionEventFired is set to true, the
event is not sent yet.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]