ZkConnection not really thread-safe
Opened this issue · 0 comments
facboy commented
ZkConnection
does not really look thread-safe to me. It locks _zk
for the connect
and close
methods, but _zk
itself is not volatile
so there are no visibility guarantees when it is accessed by all the other methods.
as an aside, ReentrantLock
could easily be replaced by a synchronized
block/method in connect
and close
.