Hi,

I have researched a problem with broken keepalive connections which is similar to bug# 41109. And I have found that in worker.c function
'int ap_graceful_stop_signalled(void)' returns listener_may_exit.
Basically all the code is like this:

int ap_graceful_stop_signalled(void)
/*....*/
{
/* note: for a graceful termination, listener_may_exit will be set before
     *       workers_may_exit, so check listener_may_exit
     */
    return listener_may_exit;
}
And it causes keepalive connection to terminate abruptly if server process exceeds MaxRequestsPerChild.

In prefork.c for instance this function is different and states for:

int ap_graceful_stop_signalled(void)
{
    /* not ever called anymore... */
    return 0;
}

As far as it is called only from 'static int ap_process_http_connection(conn_rec *c)'
'if (ap_graceful_stop_signalled())
            break;' out of serving loop,
I believe 'ap_graceful_stop_signalled' to 'return 0' will solve the problem.
Have tried with trunk and 2.2.x branch with the same positive result.

Patch for trunk is attached.

--
Best regards,
Dmytro
Index: server/mpm/worker/worker.c
===================================================================
--- server/mpm/worker/worker.c  (revision 545597)
+++ server/mpm/worker/worker.c  (working copy)
@@ -513,14 +513,9 @@
  */
 
 int ap_graceful_stop_signalled(void)
-    /* XXX this is really a bad confusing obsolete name
-     * maybe it should be ap_mpm_process_exiting?
-     */
 {
-    /* note: for a graceful termination, listener_may_exit will be set before
-     *       workers_may_exit, so check listener_may_exit
-     */
-    return listener_may_exit;
+    /* not ever called anymore... */
+    return 0;
 }
 
 /*****************************************************************

Reply via email to