You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2019/06/26 23:47:11 UTC
[GitHub] [zookeeper] BELUGABEHR commented on issue #888: ZOOKEEPER-3347:
Improve PathTrie Consistency
BELUGABEHR commented on issue #888: ZOOKEEPER-3347: Improve PathTrie Consistency
URL: https://github.com/apache/zookeeper/pull/888#issuecomment-506084474
@anmolnar I just built it locally, with unit tests, and everything was happy.
The idea here is that the internal data structure (Map of Maps) is protected with an object-level lock. Currently, each Map has its own lock which doesn't seem like it would work because the lock is released between calls to 'get', 'put', and 'remove' and therefore the state of the underlying structure can change in the middle of an operation and cause undefined behaviors in a busy environment. In my proposed solution, when the thread grabs a lock upon entering the method, it holds the lock for the entire operation so no changes can occur on the internal data structure until the thread has completed doing all of the changes it requires. This removes the risk of race conditions.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services