jiajunwang commented on a change in pull request #1101:
URL: https://github.com/apache/helix/pull/1101#discussion_r442567886



##########
File path: 
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -2138,11 +2139,14 @@ private void recordFailure(String path, 
ZkClientMonitor.AccessType accessType) {
     }
   }
 
-  private void recordStateChange(boolean stateChanged, boolean dataChanged) {
+  private void recordStateChange(boolean stateChanged, boolean dataChanged, 
boolean sessionExpired) {
     // update state change counter.
     if (_monitor != null) {
       if (stateChanged) {
         _monitor.increaseStateChangeEventCounter();
+        if (sessionExpired) {

Review comment:
       I think it would be simpler that we let the caller checking this 
dependency but not the record method.
   
   So just do
   if (stateChange) {}
   if (dataChange) {}
   if (sessionExpired) {}

##########
File path: 
zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/TestRawZkClient.java
##########
@@ -487,6 +488,50 @@ void testPendingRequestGauge()
     }
   }
 
+  @Test(dependsOnMethods = "testZkClientMonitor")
+  void testSessionExpireCount() throws Exception {

Review comment:
       This looks duplicate to the testSessionExpiry method. Could you please 
merge the test logic if possible?




----------------------------------------------------------------
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]

Reply via email to