commit: r612 - branches/spread_4_2_debug/daemon

[email protected] Fri, 25 Oct 2013 12:39:19 -0400
Newsgroups gmane.network.spread.cvs
Message-ID <[email protected]>
Author: jschultz
Date: 2013-10-25 12:39:19 -0400 (Fri, 25 Oct 2013)
New Revision: 612

Modified:
   branches/spread_4_2_debug/daemon/membership.c
   branches/spread_4_2_debug/daemon/protocol.c
   branches/spread_4_2_debug/daemon/spread.c
Log:
Trying to trigger bad edge case much more easily.


Modified: branches/spread_4_2_debug/daemon/membership.c
===================================================================
--- branches/spread_4_2_debug/daemon/membership.c	2013-10-25 16:22:07 UTC (rev 611)
+++ branches/spread_4_2_debug/daemon/membership.c	2013-10-25 16:39:19 UTC (rev 612)
@@ -2031,7 +2031,7 @@
 		send_scat.num_elements = 1;
 
 		form_token->type = 0;
-		form_token->seq = -1; /*0;*/
+		form_token->seq = 0; /*-1;*/ /*0;*/
 		form_token->aru = Last_seq;
 		form_token->flow_control = 0;
 		form_token->rtr_len = 0;

Modified: branches/spread_4_2_debug/daemon/protocol.c
===================================================================
--- branches/spread_4_2_debug/daemon/protocol.c	2013-10-25 16:22:07 UTC (rev 611)
+++ branches/spread_4_2_debug/daemon/protocol.c	2013-10-25 16:39:19 UTC (rev 612)
@@ -373,6 +373,15 @@
         for( i = 0; i < num_buffered_packets; i++)
         {
                 pack_ptr = Buffered_packets[i].head;
+
+		if (pack_ptr->seq == 1 && rand() / (RAND_MAX + 1.0) < 0.75 ) {
+
+		  Alarm( PROTOCOL, "Prot_handle_bcast: DEBUG dropping packet %d to try to invoke bad edge case\n",
+			 pack_ptr->seq);
+		  dispose(Buffered_packets[i].head);
+		  dispose(Buffered_packets[i].body);
+		  continue;		  
+		}
                  
                 /* do we have this packet */
                 if( pack_ptr->seq <= Aru )
@@ -1297,7 +1306,7 @@
             Highest_fifo_seq     = INITIAL_SEQUENCE_NEAR_WRAP;
             My_aru	    	 = INITIAL_SEQUENCE_NEAR_WRAP;
             Aru		         = INITIAL_SEQUENCE_NEAR_WRAP;
-            Set_aru		 = INITIAL_SEQUENCE_NEAR_WRAP -1;
+            Set_aru		 = INITIAL_SEQUENCE_NEAR_WRAP - 1;
             Last_discarded	 = INITIAL_SEQUENCE_NEAR_WRAP;
             Last_delivered	 = INITIAL_SEQUENCE_NEAR_WRAP;
         } else {

Modified: branches/spread_4_2_debug/daemon/spread.c
===================================================================
--- branches/spread_4_2_debug/daemon/spread.c	2013-10-25 16:22:07 UTC (rev 611)
+++ branches/spread_4_2_debug/daemon/spread.c	2013-10-25 16:39:19 UTC (rev 612)
@@ -162,7 +162,13 @@
 	Conf_init( Config_file, My_name );
 
 	E_init();
+	
+	{
+	  sp_time t = E_get_time();
 
+	  srand((int) (t.sec + t.usec));
+	}
+
 #ifndef	ARCH_PC_WIN95
         /* Verify that unix socket dir is safe if runing as root user */
         if (geteuid() == (uid_t) 0) {