zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] BELUGABEHR commented on issue #888: ZOOKEEPER-3347: Improve PathTrie Consistency
Date Wed, 26 Jun 2019 23:47:11 GMT
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

Mime
View raw message