On 0.94, HConnectionImplementation has code like this:
The issue is that between the time that getZooKeeperWatcher is called and this.zooKeeper is used, this.zooKeeper can be set to null by another thread via resetZooKeeperTrackers.
The cleanest solution to me seems to be to cache the value. I have a patch that does this and a test that fails without the patch and passes with it.
This issue doesn't appear on 0.96 because the zookeeper code has been separated in