Github user cammckenzie commented on a diff in the pull request:

    https://github.com/apache/curator/pull/262#discussion_r179001383
  
    --- Diff: 
curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java
 ---
    @@ -253,6 +253,7 @@ private void processEvents()
                 {
                     int lastNegotiatedSessionTimeoutMs = 
client.getZookeeperClient().getLastNegotiatedSessionTimeoutMs();
                     int useSessionTimeoutMs = (lastNegotiatedSessionTimeoutMs 
> 0) ? lastNegotiatedSessionTimeoutMs : sessionTimeoutMs;
    +                useSessionTimeoutMs = sessionExpirationPercent > 0 && 
startOfSuspendedEpoch != 0 ? (useSessionTimeoutMs * sessionExpirationPercent) / 
100 : useSessionTimeoutMs;
    --- End diff --
    
    I think you're right about synchronization of access to the 
startOfSuspendedEpoch here. It can be modified via the addStateChange and 
setToSuspended methods (which already synchronize access to it). I wonder if 
it's cleaner just to make startOfSuspendedEpoch volatile?


---

Reply via email to