From: Jeff Trawick Date: Tue, 10 Jul 2001 18:56:55 +0000 (+0000) Subject: Check the pod after processing a connection so that we'll go away X-Git-Tag: 2.0.21~72 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81d792e5e25258b3a43aaf3a7e4c12981c982a8a;p=apache Check the pod after processing a connection so that we'll go away if a graceful restart occurred while we were processing the connection. Otherwise, we won't wake up until a real connection comes in and we'll use the wrong config to process it and we may block in the wrong syscall (because the new generation is using a different accept mutex) and in general it is goofy. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89531 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 84c74c07b5..54699070e9 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -670,18 +670,7 @@ static void child_main(int child_num_arg) */ for (;;) { ap_sync_scoreboard_image(); - if (die_now) { - /* we didn't get a socket, and we were told to die */ - clean_child_exit(0); - } stat = apr_accept(&csd, sd, ptrans); - /* In reality, this could be done later, but to keep it - * consistent with MPMs that have a thread race-condition, - * we will do it here. - */ - if (!ap_mpm_pod_check(pod)) { - die_now = 1; - } if (stat == APR_SUCCESS || !APR_STATUS_IS_EINTR(stat)) break; } @@ -785,9 +774,6 @@ static void child_main(int child_num_arg) } ap_sync_scoreboard_image(); - if (die_now) { - clean_child_exit(0); - } } SAFE_ACCEPT(accept_mutex_off()); /* unlock after "accept" */ @@ -826,6 +812,16 @@ static void child_main(int child_num_arg) ap_lingering_close(current_conn); } + /* Check the pod after processing a connection so that we'll go away + * if a graceful restart occurred while we were processing the + * connection. Otherwise, we won't wake up until a real connection + * comes in and we'll use the wrong config to process it and we may + * block in the wrong syscall (because the new generation is using a + * different accept mutex) and in general it is goofy. + */ + if (!ap_mpm_pod_check(pod)) { + die_now = 1; + } ap_sync_scoreboard_image(); } clean_child_exit(0);