Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zookeeper: work-around SessionTracker racy initialisation on startup
Motivation: ZooKeeper server accepts requests before the server is fully initialised. This creates a race-condition for whether the SessionTracker is initialised. If the thread initialising ZooKeeperServer looses this race then there are stack-traces like: java.lang.NullPointerException: null at org.apache.zookeeper.server.ZooKeeperServer.createSession(ZooKeeperServer.java:569) ~[zookeeper-3.4.8.jar:3.4.8--1] at org.apache.zookeeper.server.ZooKeeperServer.processConnectRequest(ZooKeeperServer.java:902) ~[zookeeper-3.4.8.jar:3.4.8--1] at org.apache.zookeeper.server.NIOServerCnxn.readConnectRequest(NIOServerCnxn.java:418) ~[zookeeper-3.4.8.jar:3.4.8--1] at org.apache.zookeeper.server.NIOServerCnxn.readPayload(NIOServerCnxn.java:198) ~[zookeeper-3.4.8.jar:3.4.8--1] at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:244) ~[zookeeper-3.4.8.jar:3.4.8--1] at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203) ~[zookeeper-3.4.8.jar:3.4.8--1] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131] Modification: Add work-around by manually creating the SessionTracker. To do this, the access for the method must be made public, requiring the existing implicit class be made explicit. Result: Hopefully fewer races in the zookeeper service. Target: master Patch: https://rb.dcache.org/r/10260/ Request: 3.1 Request: 3.0 Request: 2.16 Require-notes: no Require-book: no Fixes: #3247 Acked-by: Tigran Mkrtchyan Conflicts: modules/dcache/src/main/java/org/dcache/zookeeper/service/ZooKeeperCell.java
- Loading branch information