-
1. Re: Locking order when lockParentForChildInsertRemove == tru
manik Mar 11, 2009 11:25 AM (in response to ksobolew)Thanks for analysing this. Have you got a unit test that specifically recreates this? It should be simple enough to simulate if it is a "classic deadlock" as you say.
-
2. Re: Locking order when lockParentForChildInsertRemove == tru
manik Mar 12, 2009 12:27 PM (in response to ksobolew)Also, parent locks are acquired first when creating children, if lockParentForChildInsertRemove is true (see MVCCNodeHelper.wrapNodeForWriting())
-
3. Re: Locking order when lockParentForChildInsertRemove == tru
ksobolew Mar 17, 2009 7:06 AM (in response to ksobolew)Sorry for the delay.
Yes, it's easy to simulate but not in a deterministic way. My "brute force" test found it just bcause it launches a torrent of threads on the poor cache :) I'll see what I can do to simplify this.
BTW: I am observing another exception that pops up sometimes: a ClassCastException in ReadCommittedNode.markForUpdate(), where an UnversionedNode is cast to NodeReference. This looks like a race between commit and modification to me, but I wasn't able to reproduce it in controlled environment. Any hints? -
4. Re: Locking order when lockParentForChildInsertRemove == tru
ksobolew Mar 17, 2009 11:43 AM (in response to ksobolew)OK, that's weird. I'm trying to prepare a simple test but all it shows is that the locking order is *supposed* to be right; looking at the code actually confirms that. So this phenomenon I am observing has to be some corner case that shows under high load.
I have some susppicions about how the DataContainer is racing with LockManager, but for now that's only some wild speculation ;) -
5. Re: Locking order when lockParentForChildInsertRemove == tru
ksobolew Mar 19, 2009 9:27 AM (in response to ksobolew)Looks like finally I got it. I reported my findings as https://jira.jboss.org/jira/browse/JBCACHE-1497
-
6. Re: Locking order when lockParentForChildInsertRemove == tru
manik Mar 19, 2009 9:38 AM (in response to ksobolew)Thanks, will take a look.