zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randgalt <...@git.apache.org>
Subject [GitHub] zookeeper pull request #377: [ZOOKEEPER-2901] TTL Nodes don't work with Serv...
Date Thu, 25 Jan 2018 04:11:08 GMT
Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/377#discussion_r163746348
  
    --- Diff: src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java ---
    @@ -476,9 +474,12 @@ public ZooKeeperServerListener getZooKeeperServerListener() {
             return listener;
         }
     
    +    // Visible for testing
    +    static volatile int serverId = 1;
    --- End diff --
    
    Here's the issue @phunt - `serverId` is consumed by `ZooKeeperServer.createSessionTracker()`.
For tests, the ZooKeeperServer is created by the **static** method `ClientBase.startServerInstance()`.
So, _I'm_ the person down the road that has to deal with the static method created long ago.
It would take significant re-write for `ClientBase.startServerInstance()` to be non-static
and parameterized.


---

Mime
View raw message