On 7 Aug 2009, at 10:18, Manik Surtani wrote:
Thanks for the patch; that makes a lot of sense. Go ahead and check
it in to trunk.
Regarding the creation of nodes for deletion, well that's pessimistic
locking for you. Unfortunately the lock is encapsulated in the node
so you can't acquire the lock until the node is created. (Which is
partially why the pessimistic lock design sucks).
This is created in PessimisticNodeBasedLockManager (line 145). At
this stage we already know if we are just creating a dummy node for
deletion, so perhaps we could pass this as a flag into the constructor
of a PessimisticUnversionedNode, and this could acquire the lock on
creation. Hmm, need to think about this.
Right, so I have created a patch for this - it isn't the prettiest in
that it exposes some PessimisticUnversionedNode internals to the
PessimisticNodeBasedLockManager, but these two (deprecated) classes
are so tightly coupled anyway that if this fixes the race then I'm
happy to go with it.
Just as an FYI, this is checked in as rev. 8167.
Cheers
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org