[Cherokee-commits] [2606] cherokee/trunk:

SVN at cherokee-project.com SVN at cherokee-project.com
Wed Dec 17 16:09:18 CET 2008


Revision: 2606
          http://svn.cherokee-project.com/changeset/2606
Author:   alo
Date:     2008-12-17 16:09:17 +0100 (Wed, 17 Dec 2008)

Log Message:
-----------


Modified Paths:
--------------
    cherokee/trunk/ChangeLog
    cherokee/trunk/cherokee/main.c
    cherokee/trunk/cherokee/server.c

Modified: cherokee/trunk/ChangeLog
===================================================================
--- cherokee/trunk/ChangeLog	2008-12-16 19:57:15 UTC (rev 2605)
+++ cherokee/trunk/ChangeLog	2008-12-17 15:09:17 UTC (rev 2606)
@@ -1,3 +1,8 @@
+2008-12-17  Alvaro Lopez Ortega  <alvaro at octality.com>
+
+	* cherokee/main.c, cherokee/server.c: This patch should fix the
+	graceful restart functionality.
+
 2008-12-16  Taher Shihadeh  <taher at unixwars.com>
 	* cherokee/cherokee-tweak.c: fixes incorrect parameter help.
 

Modified: cherokee/trunk/cherokee/main.c
===================================================================
--- cherokee/trunk/cherokee/main.c	2008-12-16 19:57:15 UTC (rev 2605)
+++ cherokee/trunk/cherokee/main.c	2008-12-17 15:09:17 UTC (rev 2606)
@@ -281,7 +281,6 @@
 static void 
 signals_handler (int sig, siginfo_t *si, void *context) 
 {
-	UNUSED(si);
 	UNUSED(context);
 
 	switch (sig) {
@@ -295,7 +294,6 @@
 		/* Graceful restart */
 		graceful_restart = true;
 		kill (pid, SIGHUP);
-		process_wait (pid);
 		break;
 
 	case SIGTERM:
@@ -307,7 +305,7 @@
 
 	case SIGCHLD:
 		/* Child exited */
-		process_wait (pid);
+		process_wait (si->si_pid);
 		break;
 		
 	default:

Modified: cherokee/trunk/cherokee/server.c
===================================================================
--- cherokee/trunk/cherokee/server.c	2008-12-16 19:57:15 UTC (rev 2605)
+++ cherokee/trunk/cherokee/server.c	2008-12-17 15:09:17 UTC (rev 2606)
@@ -1245,12 +1245,21 @@
 #endif
 
 	/* Gracefull restart:
-	 * The main thread waits for the rest
 	 */
-	if (unlikely ((srv->wanna_reinit) &&
-		      (srv->main_thread->conns_num == 0)))
-	{
-		return ret_eof;
+	if (unlikely (srv->wanna_reinit)) {
+		cherokee_list_t    *i;
+		cherokee_boolean_t  empty = true;
+
+		list_for_each (i, &srv->thread_list) {
+			if (THREAD(i)->conns_num != 0) {
+				empty = false;
+				break;
+			}
+		}
+		
+		if (empty) {
+			return ret_eof;
+		}
 	}
 
 	/* Should not be reached.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.octality.com/pipermail/cherokee-commits/attachments/20081217/9871f9b7/attachment.htm 


More information about the Cherokee-commits mailing list