Github user lvfangmin commented on the issue:
https://github.com/apache/zookeeper/pull/584
This is good enough to make the ephemerals thread safe in DataTree, if it's
being called in multiple thread, the code you touched here may add ephemerals
which is just removed in killSession.
A lot of code inside DataTree assumes that there is a single thread will
call it, and it's guaranteed from FinalRequestProcessor, which is called from
the WorkerService in CommitProcessor, and CommitProcessor guarantees only a
single write is allowed at a time. So I agree with Ben, I don't think we need
this change.
---