anmolnar commented on code in PR #2185: URL: https://github.com/apache/zookeeper/pull/2185#discussion_r1876538751
########## zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java: ########## @@ -618,9 +622,10 @@ public synchronized long restoreFromSnapshot(final InputStream inputStream) thro restoreLatch = new CountDownLatch(1); try { - // set to the new zkDatabase - setZKDatabase(newZKDatabase); - + synchronized (snapshotAndRestoreLock) { + // set to the new zkDatabase + setZKDatabase(newZKDatabase); + } Review Comment: I think you better extend the scope of sync block to `createSessionTracker()` call. -- 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. To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org