beagle r4747 - trunk/libbeagle/beagle



Author: dbera
Date: Tue May  6 13:09:51 2008
New Revision: 4747
URL: http://svn.gnome.org/viewvc/beagle?rev=4747&view=rev

Log:
* beagle-request.c: Reduce the number of connetion attempts to 10. Closes #531684. We still a need a few connection attempts because if beagled is under a heavy query load, sometimes its stack fills up and it refused further connection.


Modified:
   trunk/libbeagle/beagle/beagle-request.c

Modified: trunk/libbeagle/beagle/beagle-request.c
==============================================================================
--- trunk/libbeagle/beagle/beagle-request.c	(original)
+++ trunk/libbeagle/beagle/beagle-request.c	Tue May  6 13:09:51 2008
@@ -211,8 +211,10 @@
 	/* We retry on EGAIN or EINTR: since both of these mean the socket is active,
 	 * there is no harm in trying to retry a lot of times. A blocking socket would
 	 * have done the same.
+	 * Try maximum 10 times, more than a certain threshold means beagled is somehow
+	 * hanged and not reachable for all practical purposes.
 	 */
-#define MAX_RETRIES 500
+#define MAX_RETRIES 10 /* 10 * 200 msec ~> 2 sec */
 
 	for (retries = 0; retries < MAX_RETRIES; ++ retries) {
 		if (connect (sockfd, (struct sockaddr *) &sun, sizeof (sun)) >= 0)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]