[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Valve on HAAspect

clebert.suconic@jboss.com do-not-reply at jboss.com
Tue Dec 12 20:20:26 EST 2006


I have implemented a Valve (class org.jboss.jms.util.Valve) which will prevent two threads to enter in the same block, where the second thread will just ignore the routine.

Valve.open will return true only once... and it will wait until the first thread to execute open calls a close.

I have implemented this routine into HAAspect::handleConnectionException, however I don't know what to do if two subsequent failures happen, but not at the same time.  

If two failures happen at the same time the method I added is ok, but if a second failure happens seconds after the method is done, then the method will assume another failover is happening. On that case hpping logic should take care of that.

Ok.. I guess I'm drunk and maybe my explanation is too confused. Let me explain through an example:

Example I:
- Thread A and B, both got an IOException at the same time from ConnectionListener.
 On this case the valve will ignore one of the exceptions and will perform the client failover in only one exception

- Thread A get an exception...
- Failover happens
- Thread B get an exception after failover on client is done
- Failover will be called again, and I'm expecint hopping will be smart enough to ignore the second failover event.


if you could please take a look at the code (Ovidiu, Tim, contributors) to verify if the implementation is correct. Maybe you thought about something I didn't think.


Cheers,



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

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



More information about the jboss-dev-forums mailing list