dev@shoal.java.net

Re: [Shoal-Users] Re: Shoal - Unable acquire FailureRecoverySignal

From: Bongjae Chang <carryel_at_korea.com>
Date: Mon, 3 Nov 2008 14:32:39 +0900

Hi Chathurika Sandarenu.

FailureRecoveryActionFactoryImpl and FailureRecoveryActionImpl already offered signal.acquire() before user's callback would be executed.
After user's callback finished, they also call signal.release(). So when you used signal.acquire(), exception was thrown because signal.acquire() was duplicated.

In other words, when server1 failed and server2 recovered server1 from user's FailureRecoveryCallBack, you didn't need to call both signal.acquire() and signal.release().

If server1 revives while server2 is recovering, as your words, server1 can check isFenced() with while loop.
ex)
while( isFenced() ) {
    // wait for a while with retrial count
}

If I misunderstood your words, please give advice to me.

--
Bongjae Chang


  ----- Original Message -----
  From: Chathurika Sandarenu
  To: carryel_at_korea.com ; users_at_shoal.dev.java.net ; dev_at_shoal.dev.java.net
  Sent: Monday, November 03, 2008 12:12 PM
  Subject: [Shoal-Users] Re: Shoal - Unable acquire FailureRecoverySignal


  Hi Bongjae Chang,

  Thanks for replying. I'm using FailureRecoveryActionFactoryImpl when I'm registering for group events.
  gms.addActionFactory(recoveryComponent, new FailureRecoveryActionFactoryImpl(object));

  According to your reply this means that I don't have to call faliureNotify.acquire() from my callback function.

  In my application there are 2 servers; server1(main server) and server2(backup server). If the server1 fails server2 has to start operations and when server1 come back, server2 has to stop and allow server1 to perform operations. When server1 come live after a failure I have to block it until server2 stops the operations. Is there a way in shoal which I can use to program this requirement.
  Currently I'm using FailureRecoverySignal to start operations on server2 when server1 starts. And I use JoinNotificationSignal from server1 to stop the operations of server2. But with this model I've a problem because for small period of time both servers are performing operations.

  I saw that in shoal there is isFenced() method to handle these kind of senarios. Previosly I tried to use faliureNotify.acquire() to raise the fence on failed server and stop it from joining to the group when it come back live. But that was not a success since it throw an exception.

  Can you please help on this?

  Regards,
  Chathurika Sandarneu.