curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randgalt <...@git.apache.org>
Subject [GitHub] curator pull request #262: [CURATOR-460] Timed tolerance for connection susp...
Date Fri, 06 Apr 2018 03:08:46 GMT
Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/curator/pull/262#discussion_r179651175
  
    --- Diff: curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateManager.java
---
    @@ -340,4 +338,12 @@ private void setCurrentConnectionState(ConnectionState newConnectionState)
             currentConnectionState = newConnectionState;
             startOfSuspendedEpoch = (currentConnectionState == ConnectionState.SUSPENDED)
? System.currentTimeMillis() : 0;
         }
    +
    +    private synchronized int getUseSessionTimeoutMs() {
    --- End diff --
    
    Looks like the comment on `startOfSuspendedEpoch` "guarded by sync" is a lie. `getUseSessionTimeoutMs()`
doesn't need to be synchronized if we make `startOfSuspendedEpoch` volatile.


---

Mime
View raw message