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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...