[jboss-cvs] JBoss Messaging SVN: r5276 - in branches/Branch_JBMESSAGING_1416: src/main/org/jboss/messaging/core/impl/postoffice and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 5 07:37:47 EST 2008


Author: gaohoward
Date: 2008-11-05 07:37:47 -0500 (Wed, 05 Nov 2008)
New Revision: 5276

Modified:
   branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/ChannelSupport.java
   branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/MessagingQueue.java
   branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/OrderingGroup.java
   branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/OrderingGroupMonitor.java
   branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/PagingChannelSupport.java
   branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java
   branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
   branches/Branch_JBMESSAGING_1416/tests/src/org/jboss/test/messaging/jms/clustering/OrderingGroupBasicClusteringTest.java
Log:
JBMESSAGING-1416 


Modified: branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/ChannelSupport.java
===================================================================
--- branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/ChannelSupport.java	2008-11-05 11:32:24 UTC (rev 5275)
+++ branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/ChannelSupport.java	2008-11-05 12:37:47 UTC (rev 5276)
@@ -591,7 +591,7 @@
     *
     * @see org.jboss.messaging.core.contract.Channel#deliver()
     */
-   /*debug use, delete them!!!*/
+   /*debug use, delete them!!!
    private void dlog(String lgmsg)
    {
       log.error("(*)-" + lgmsg);
@@ -600,7 +600,7 @@
    {
       dlog(lgmsg + this.getRefText(r));
    }
-   /*debug*/
+   debug*/
    protected void deliverInternal()
    {
       if (trace) { log.trace(this + " was prompted delivery"); }
@@ -625,19 +625,9 @@
 
             if (ref != null)
             {
-dlog("========================================================================trace==========================================");
-StackTraceElement[] elements = Thread.currentThread().getStackTrace();
-for (StackTraceElement eme : elements)
-{
-   log.error("*" + eme.toString());
-}
-dlog("========================================================================trace end==========================================");
-               //challengeSend can return: 1. ok because ref is not ordered. 2. ok because the ref is the first and available for sending 3. not ok because the ref is not the first and available for sending.
-               // 4. not ok because the ref is the birst but is not available for sending (being sent).
                int status = monitor.isAvailable(ref);
                if (status != OrderingGroupMonitor.OK)
                {
-                  dlog("==================message is not ok for sending. " + status, ref);
                   //iterating time
                   if (iter == null)
                   {
@@ -649,7 +639,6 @@
                else
                {
                   // Attempt to push the ref to a receiver
-                  dlog("==================sending ", ref);
 
                   if (trace)
                   {
@@ -701,7 +690,6 @@
 
                      monitor.markSending(ref);
                      
-                     dlog("===================== message sent ok. ", ref);
                      // Receiver accepted the reference
                      synchronized (lock)
                      {
@@ -841,31 +829,23 @@
          }
       }
       
-      dlog("******** ACKNOWLEDGE MESSAGE: ", d.getReference());
       if (OrderingGroupMonitor.isOrderingGroupMessage(d.getReference()))
       {
          synchronized (lock)
          {
             if (monitor.messageCompleted(d.getReference()))
             {
-               dlog("******** triggering deliver here after ", d.getReference());
                deliverInternal();
             }
-            else
-            {
-               dlog("*************no need to triger, something wrong?????????");
-            }
          }
       }
       else
       {
          MessageReference ref = d.getReference();
-         dlog("******** message is not a group member!!!!, something wrong!!!!", ref);
          org.jboss.messaging.core.contract.Message msg2 = ref.getMessage();
          if (msg2 instanceof JBossMessage)
          {
             JBossMessage rmsg = (JBossMessage)msg2;
-            dlog("********** msg group name: " + rmsg.getStringProperty(JBossMessage.JBOSS_MESSAGING_ORDERING_GROUP_ID) + " for msg: ", ref);
          }
       }
    }

Modified: branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/MessagingQueue.java
===================================================================
--- branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/MessagingQueue.java	2008-11-05 11:32:24 UTC (rev 5275)
+++ branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/MessagingQueue.java	2008-11-05 12:37:47 UTC (rev 5276)
@@ -210,7 +210,6 @@
    {
       if (trace) { log.trace("Merging queue " + channelID + " node id " + nodeID + " into " + this + 
       		                 " initially refs:" + messageRefs.size()); }
-log.error("$$$$$$$$$$ " + "In mergeIn, my node is : " + getNodeID() + " the dead one is " + nodeID);
       synchronized (lock)
       {
          flushDownCache();
@@ -253,7 +252,6 @@
          			re.ref = ref;
          			re.sessionID = sessionID;
 
-log.error("=========================put to recovery map: " + ChannelSupport.getRefText(ref));
          			recoveryMap.put(new Long(message.getMessageID()), re);
          			
          			deliveringCount.increment();
@@ -674,7 +672,6 @@
 		public void timedOut(Timeout timeout)
 		{
 			if (trace) { log.trace("ClearRecoveryMap timeout fired"); }
-log.error("*******************************finally the recover happend");			
 			Iterator iter = ids.iterator();
 			
 			boolean added = false;
@@ -683,16 +680,13 @@
 			{
 				MessageReference ref = (MessageReference)iter.next();
 
-log.error("********** message ref to be removed is: " + ChannelSupport.getRefText(ref));
 				Object obj = recoveryMap.remove(new Long(ref.getMessage().getMessageID()));
-log.error("*********obj in recoveryMap: " + obj);				
 				if (obj != null)
 				{
 					if (trace) { log.trace("Adding ref " + ref + " back into queue"); }
 						
 					synchronized (lock)
 					{
-log.error("********** adding to-recover message ref to list" + ChannelSupport.getRefText(ref));
 						messageRefs.addFirst(ref, ref.getMessage().getPriority());		
 						
 						deliveringCount.decrement();

Modified: branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/OrderingGroup.java
===================================================================
--- branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/OrderingGroup.java	2008-11-05 11:32:24 UTC (rev 5275)
+++ branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/OrderingGroup.java	2008-11-05 12:37:47 UTC (rev 5276)
@@ -77,6 +77,8 @@
       ReferenceHolder holder = refMap.get(mid);
       if (holder != null)
       {
+         //is there a case where the ref can be registered more than once?
+         //if not, we simply remove the addRef().
          holder.addRef();
          return true;
       }
@@ -108,7 +110,6 @@
       ReferenceHolder holder = sortedList.getFirst();
       if (holder == null) 
       {
-         log.error("==============message ok because the group is empty!!!!");
          return OrderingGroupMonitor.OK;
       }
       
@@ -130,7 +131,6 @@
       if (holder.matchMessage(ref))
       {
          long count = holder.releaseSendnRef();
-log.error("_______________________________________count is: " + count + " for " + ChannelSupport.getRefText(ref));
          if (count == 0)
          {
             sortedList.removeFirst();
@@ -339,18 +339,16 @@
       {
          if (pendingSentCount < refCount)
          {
-            log.error("===============ref is ok, " + pendingSentCount + " " + refCount);
             return OrderingGroupMonitor.OK;
          }
-         log.error("===============ref is not ok, " + pendingSentCount + " " + refCount);
          return OrderingGroupMonitor.NOT_OK_BEING_SENT;
       }
-      log.error("===============ref is not ok, because not first , the first is: " + ChannelSupport.getRefText(ref));
       return OrderingGroupMonitor.NOT_OK_NOT_FIRST;
    }
 
    /**
     * So far only allowed to register once. 
+    * revisit this later.
     */
    public void addRef()
    {
@@ -368,14 +366,12 @@
    
    /**
     * decrease the ref count
+    * here we don't care about pendingSentCount here.
     */
    public long releaseSendnRef()
    {
-//      if (pendingSentCount > 0)
-//      {
-         refCount--;
-         pendingSentCount--;
-//      }
+      refCount--;
+      pendingSentCount--;
       return refCount;
    }
 

Modified: branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/OrderingGroupMonitor.java
===================================================================
--- branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/OrderingGroupMonitor.java	2008-11-05 11:32:24 UTC (rev 5275)
+++ branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/OrderingGroupMonitor.java	2008-11-05 12:37:47 UTC (rev 5276)
@@ -97,9 +97,7 @@
    public int isAvailable(MessageReference ref)
    {
       int result = OK;
-      log.error("===================isAvaialbe caled., extracting name" + ref);
       String grpName = extractGroupName(ref);
-      log.error("===================isAvaialbe., extracting name" + grpName);
       if (grpName != null)
       {
          synchronized (orderingGroups)
@@ -109,15 +107,10 @@
             {
                result = group.isAvailable(ref);
             }
-            else
-            {
-               log.error("============the group is not exist for this guy!!!!!, some thing wrong!!!");
-            }
          }
       }
       else
       {
-         log.error("------------------=========================message doesn't have group prop, fine by me");
          log.debug("message doesn't have group prop, fine by me");
       }
       return result;

Modified: branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/PagingChannelSupport.java
===================================================================
--- branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/PagingChannelSupport.java	2008-11-05 11:32:24 UTC (rev 5275)
+++ branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/PagingChannelSupport.java	2008-11-05 12:37:47 UTC (rev 5276)
@@ -505,7 +505,6 @@
          MessageReference added = addFromRefInfo(info, refMap);
          //note, we registered the ref 'after' it has been added to the list
          //it is safe as long as the caller of this method is synchronized on lock.
-         log.error("******************* registering loaded message: " + ChannelSupport.getRefText(added));
          monitor.registerMessage(added, null);
       }
    }

Modified: branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java
===================================================================
--- branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java	2008-11-05 11:32:24 UTC (rev 5275)
+++ branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java	2008-11-05 12:37:47 UTC (rev 5276)
@@ -113,7 +113,7 @@
      
    public void start() throws Exception
    {		
-log.error("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ group member is starting....");
+
    	this.controlChannel = jChannelFactory.createControlChannel();
    	
       this.dataChannel = jChannelFactory.createDataChannel();

Modified: branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2008-11-05 11:32:24 UTC (rev 5275)
+++ branches/Branch_JBMESSAGING_1416/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2008-11-05 12:37:47 UTC (rev 5276)
@@ -262,7 +262,6 @@
       throws Exception
    {
    	super (ds, tm, sqlProperties, createTablesOnStartup);
-log.error("======================================================post office (non-cluster) starting!!!");   
 
       this.thisNodeID = nodeId;
       
@@ -321,7 +320,6 @@
       this.clustered = true;
       
       this.failoverOnNodeLeave = failoverOnNodeLeave;
-log.error("======================================================post office starting!!!");   
       groupMember = new GroupMember(groupName, stateTimeout, castTimeout, jChannelFactory, this, this);
 
       this.supportsFailover = supportsFailover;
@@ -964,7 +962,7 @@
 		         // The node crashed and we are the failover node so let's perform failover
 		
 		         log.debug(this + ": I am the failover node for node " + leftNodeID + " that crashed");
-log.error("$$$$$$ " + "Node " + leftNodeID + " leaving!!!!, performFailover!!!!");
+
 		         performFailover(leftNodeID);
 		         
 		         doneFailover = true;
@@ -2938,7 +2936,6 @@
     */
    private void performFailover(Integer failedNodeID) throws Exception
    {
-log.error("################################################33$$$$$$$$$$ " + "performing failover called, the failed id is: " + failedNodeID);
 
    	log.info("JBoss Messaging is failing over for failed node " + failedNodeID + 
    			   ". If there are many messages to reload this may take some time...");
@@ -2949,7 +2946,6 @@
 
       log.debug(this + " announced it is starting failover procedure");
    	
-log.error("$$$$$$$$$$ " + "merging transactions ...");
       pm.mergeTransactions(failedNodeID.intValue(), thisNodeID);
       
       // Need to lock
@@ -3023,7 +3019,6 @@
                //need to merge the queues
             	
             	log.debug(this + " has already a queue: " + queue.getName() + " queue so merging queues");
-log.error("$$$$$$$$$$ " + "Performing mergIng for " + localQueue.getName() + "for failed node: " + failedNodeID);
                localQueue.mergeIn(queue.getChannelID(), failedNodeID.intValue());
                
                log.debug("Merged queue");       

Modified: branches/Branch_JBMESSAGING_1416/tests/src/org/jboss/test/messaging/jms/clustering/OrderingGroupBasicClusteringTest.java
===================================================================
--- branches/Branch_JBMESSAGING_1416/tests/src/org/jboss/test/messaging/jms/clustering/OrderingGroupBasicClusteringTest.java	2008-11-05 11:32:24 UTC (rev 5275)
+++ branches/Branch_JBMESSAGING_1416/tests/src/org/jboss/test/messaging/jms/clustering/OrderingGroupBasicClusteringTest.java	2008-11-05 12:37:47 UTC (rev 5276)
@@ -76,7 +76,7 @@
    
    public void testOrderingKillFailoverNodeTx() throws Exception
    {
-      //testKillFailoverNode(true);
+      testKillFailoverNode(true);
    }
 
    
@@ -146,7 +146,6 @@
          assertNotNull(tm);
          //assertEquals("message5", tm.getText());
          String gropname= tm.getStringProperty(JBossMessage.JBOSS_MESSAGING_ORDERING_GROUP_ID);
-         System.err.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>groupname recied" + gropname);
 
          // We kill the failover node for node 1
          int failoverNodeId = this.getFailoverNodeForNode(factory, 1);
@@ -219,6 +218,9 @@
          ids = (Map) recoveryArea.get(new Integer(1));
          assertNull(ids);
 
+         Message moreMsg = cons1.receive(2000);
+         assertNull(moreMsg);
+         
          // Now ack
          if (transactional)
          {
@@ -242,7 +244,8 @@
 
          log.info("Created consumer");
 
-         System.err.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>sleeping for 310 sec to allow recover time out happens>>>>>>>>>>>>>>>>");
+         /*
+         log.info("sleeping for 310 sec to allow recovering timeout to happen");
          try
          {
             Thread.sleep(310000);
@@ -251,13 +254,13 @@
          {
             log.warn("sleeping interrupted, time may not be enough for recovery");
          }
+         */
+         
          // the remaining messages should be received.
          for (int i = numMessages/2 + 1; i < numMessages; i++)
          {
             tm = (TextMessage) cons1.receive(2000);
             assertNotNull(tm);
-            System.err.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> : " + tm.getText());
-            System.err.println(">>>>>>>>.this group name: " + tm.getStringProperty(JBossMessage.JBOSS_MESSAGING_ORDERING_GROUP_ID));
             assertEquals("message" + i, tm.getText());
          }
       } finally




More information about the jboss-cvs-commits mailing list