[jbosscache-commits] JBoss Cache SVN: r4932 - core/trunk/src/main/java/org/jboss/cache/buddyreplication.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Jan 1 19:32:16 EST 2008


Author: manik.surtani at jboss.com
Date: 2008-01-01 19:32:16 -0500 (Tue, 01 Jan 2008)
New Revision: 4932

Modified:
   core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
Log:
Ensure the view changes queue is cleared before starting view change listener thread

Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java	2008-01-02 00:31:47 UTC (rev 4931)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java	2008-01-02 00:32:16 UTC (rev 4932)
@@ -236,6 +236,7 @@
       }
    }
 
+   // For now, this is initialised MANUALLY from CacheImpl.internalStart()
    public void init() throws CacheException
    {
       log.debug("Starting BuddyManager");
@@ -260,6 +261,7 @@
 
       // assign buddies based on what we know now
       reassignBuddies(cache.getMembers());
+      queue.clear();
       asyncViewChangeHandler.start();
    }
 
@@ -1048,6 +1050,7 @@
 
       public void run()
       {
+         log.trace("Started");
          // don't start this thread until the Buddy Manager has initialised as it cocks things up.
          try
          {
@@ -1082,6 +1085,7 @@
          MembershipChange members = queue.take();
          if (members == STOP_NOTIFIER)
          {
+            log.trace("Caught stop notifier, time to go home.");
             // time to go home
             isRunning = false;
             return;
@@ -1108,6 +1112,7 @@
                log.trace("Not received necessary buddy pool info for all new members yet; waiting on poolInfoNotifierLock.");
                while (!receivedBuddyInfo)
                   poolInfoNotifierLock.wait();
+               log.trace("Notified!!");
                receivedBuddyInfo = false;
             }
          }




More information about the jbosscache-commits mailing list