[jboss-dev-forums] [Design of JBossCache] - Re: Locking tree before setting initial state

bstansberry@jboss.com do-not-reply at jboss.com
Mon Sep 11 17:00:25 EDT 2006


Thought a bit about the idea of locking / on the state recipient before it calls channel.getState().  The idea is to ensure that the received state can be integrated w/o concern about not being able to acquire the required read lock. Problems I see:

1) Race with the state provider, where the provider issues a prepare while the recipient issues getState().  Result is a deadlock until either the state transfer or the prepare() times out, or the tx that issued the prepare is rolled back on the state provider.

Actually, even worse.  The prepare() call will be waiting to lock / and blocking the jg uphandler thread on the state recipient .  That will prevent receipt of any rollback() message or any subsequently transferred state, so the state transfer will be unable to go through until the prepare() fails with a lock timeout.

2) Race with a 3rd node in the cluster where the prepare() gets to the state provider before the getState() call.  Again deadlock until the prepare() times out.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970838#3970838

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970838



More information about the jboss-dev-forums mailing list