Github user MichaelScofield commented on the issue:
https://github.com/apache/zookeeper/pull/584
@anmolnar Sorry for the late response. I think what @lvfangmin wants to put
here, is that `createNode()` is called in single thread, so the race condition
does not exist. **IF** there were
Github user maoling commented on the issue:
https://github.com/apache/zookeeper/pull/584
sorry ,too embarrassed.I was wrong about my previous opinion. look at my
thread-pool [unit
test](https://github.com/maoling/zookeeper/blob/ZOOKEEPER-3102/src/java/test/org/apache/zookeeper/server/
Github user anmolnar commented on the issue:
https://github.com/apache/zookeeper/pull/584
@MichaelScofield Would you please respond to @lvfangmin 's comment?
If this change doesn't make creating ephemerals thread-safe, there's no
value in committing it.
---
Github user MichaelScofield commented on the issue:
https://github.com/apache/zookeeper/pull/584
@anmolnar Thanks for the `computeIfAbsent` suggestion. Modified codes
accordingly.
@breed @lvfangmin I'm aware that `createNode` is single-threaded, and the
race condition I revealed i
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.
Github user breed commented on the issue:
https://github.com/apache/zookeeper/pull/584
i'm not sure this is an issue. there is a single thread
(FileRequestProcessor) that does all the mutations, so i don't think there is a
race here. there might be a race in other places, but we need