From 209f69342377e36589d9eed371da3235adb525b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Fri, 15 Nov 2013 19:30:52 +0100 Subject: [PATCH] - rel 2; better way of dealing with children at graceful reload --- apache.spec | 2 +- httpd-dummy-connection-result.patch | 36 +++++++++++++---------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/apache.spec b/apache.spec index ae91ffe..c8bc419 100644 --- a/apache.spec +++ b/apache.spec @@ -35,7 +35,7 @@ Summary(ru.UTF-8): Самый популярный веб-сервер Summary(tr.UTF-8): Lider WWW tarayıcı Name: apache Version: 2.4.6 -Release: 1 +Release: 2 License: Apache v2.0 Group: Networking/Daemons/HTTP Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2 diff --git a/httpd-dummy-connection-result.patch b/httpd-dummy-connection-result.patch index b2c70cc..81f0f08 100644 --- a/httpd-dummy-connection-result.patch +++ b/httpd-dummy-connection-result.patch @@ -1,21 +1,17 @@ ---- httpd-2.4.4.org/server/mpm_unix.c 2012-07-03 21:38:58.000000000 +0200 -+++ httpd-2.4.4/server/mpm_unix.c 2013-04-15 14:27:54.197655418 +0200 -@@ -604,7 +604,17 @@ - len = strlen(data); - } - -- apr_socket_send(sock, data, &len); -+ rv = apr_socket_send(sock, data, &len); -+ if (rv == APR_SUCCESS && lp->protocol && strcasecmp(lp->protocol, "http") == 0) { -+ char *buffer[10]; // dummy buffer to see if child is alive -+ -+ len = sizeof(buffer); -+ rv = apr_socket_recv(sock, buffer, &len); -+ if (rv != APR_SUCCESS) { -+ ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, ap_server_conf, -+ "receiving response to dummy data to listener on %pI", lp->bind_addr); +diff --git a/server/mpm_unix.c b/server/mpm_unix.c +index a70c271..ca880e5 100644 +--- a/server/mpm_unix.c ++++ b/server/mpm_unix.c +@@ -742,7 +742,12 @@ void ap_mpm_pod_killpg(ap_pod_t *pod, int num) + * readers stranded (a number of them could be tied up for + * a while serving time-consuming requests) + */ ++ /* Recall: we only worry about IDLE child processes here */ + for (i = 0; i < num && rv == APR_SUCCESS; i++) { ++ if (ap_scoreboard_image->servers[i][0].status != SERVER_READY || ++ ap_scoreboard_image->servers[i][0].pid == 0) { ++ continue; + } -+ } - apr_socket_close(sock); - apr_pool_destroy(p); - + rv = dummy_connection(pod); + } + } -- 2.44.0