From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 674CC138334 for ; Fri, 24 Aug 2018 00:56:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1EEAAE0874; Fri, 24 Aug 2018 00:56:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DA244E0874 for ; Fri, 24 Aug 2018 00:56:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B47A9335CA0 for ; Fri, 24 Aug 2018 00:56:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CE7CC2A9 for ; Fri, 24 Aug 2018 00:56:20 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1535072144.f3fdd0e0b70833ffebc5a45732a48eb6a359fce5.whissi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/apache/, www-servers/apache/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: www-servers/apache/apache-2.4.34-r1.ebuild www-servers/apache/apache-2.4.34-r2.ebuild www-servers/apache/files/apache-2.4.34-PR62557.patch X-VCS-Directories: www-servers/apache/files/ www-servers/apache/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: f3fdd0e0b70833ffebc5a45732a48eb6a359fce5 X-VCS-Branch: master Date: Fri, 24 Aug 2018 00:56:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4d1c34e9-f018-4fa2-a53d-1f96662e35d0 X-Archives-Hash: 38c7ebff8955c4dba51b43f523d5fe88 commit: f3fdd0e0b70833ffebc5a45732a48eb6a359fce5 Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Aug 24 00:55:44 2018 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Aug 24 00:55:44 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3fdd0e0 www-servers/apache: fix the issue with lbmethod_* load order Closes: https://bugs.gentoo.org/663312 Package-Manager: Portage-2.3.48, Repoman-2.3.10 RepoMan-Options: --force ...he-2.4.34-r1.ebuild => apache-2.4.34-r2.ebuild} | 1 + .../apache/files/apache-2.4.34-PR62557.patch | 216 +++++++++++++++++++++ 2 files changed, 217 insertions(+) diff --git a/www-servers/apache/apache-2.4.34-r1.ebuild b/www-servers/apache/apache-2.4.34-r2.ebuild similarity index 99% rename from www-servers/apache/apache-2.4.34-r1.ebuild rename to www-servers/apache/apache-2.4.34-r2.ebuild index d9a72b6f05c..db0368ea9f7 100644 --- a/www-servers/apache/apache-2.4.34-r1.ebuild +++ b/www-servers/apache/apache-2.4.34-r2.ebuild @@ -151,6 +151,7 @@ REQUIRED_USE="apache2_modules_http2? ( ssl ) PATCHES=( "${FILESDIR}/${PN}-2.4.34-suexec_parallel_install.patch" #661358 + "${FILESDIR}"/${P}-PR62557.patch #663312 ) pkg_setup() { diff --git a/www-servers/apache/files/apache-2.4.34-PR62557.patch b/www-servers/apache/files/apache-2.4.34-PR62557.patch new file mode 100644 index 00000000000..d95a9864d1b --- /dev/null +++ b/www-servers/apache/files/apache-2.4.34-PR62557.patch @@ -0,0 +1,216 @@ +From d7713339dbde7cfa4cfc9914f683b4644dcab92e Mon Sep 17 00:00:00 2001 +From: Ruediger Pluem +Date: Fri, 20 Jul 2018 19:27:31 +0000 +Subject: [PATCH] * mod_proxy: Remove load order and link dependency between + mod_lbmethod_* modules and mod_proxy by providing mod_proxy's + ap_proxy_balancer_get_best_worker as an optional function. + +PR: 62557 + + +git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836381 13f79535-47bb-0310-9956-ffa450edef68 +--- + CHANGES | 3 +++ + include/ap_mmn.h | 5 +++- + modules/proxy/balancers/mod_lbmethod_bybusyness.c | 28 ++++++++++++++++++++++- + modules/proxy/balancers/mod_lbmethod_byrequests.c | 28 ++++++++++++++++++++++- + modules/proxy/balancers/mod_lbmethod_bytraffic.c | 28 ++++++++++++++++++++++- + modules/proxy/mod_proxy.h | 8 +++++++ + modules/proxy/proxy_util.c | 1 + + 7 files changed, 97 insertions(+), 4 deletions(-) + +--- apache2.orig/modules/proxy/balancers/mod_lbmethod_bybusyness.c ++++ apache2/modules/proxy/balancers/mod_lbmethod_bybusyness.c +@@ -22,6 +22,9 @@ + + module AP_MODULE_DECLARE_DATA lbmethod_bybusyness_module; + ++static APR_OPTIONAL_FN_TYPE(ap_proxy_balancer_get_best_worker) ++ *ap_proxy_balancer_get_best_worker_fn = NULL; ++ + static int is_best_bybusyness(proxy_worker *current, proxy_worker *prev_best, void *baton) + { + int *total_factor = (int *)baton; +@@ -44,7 +47,7 @@ static proxy_worker *find_best_bybusynes + { + int total_factor = 0; + proxy_worker *worker = +- ap_proxy_balancer_get_best_worker(balancer, r, is_best_bybusyness, ++ ap_proxy_balancer_get_best_worker_fn(balancer, r, is_best_bybusyness, + &total_factor); + + if (worker) { +@@ -82,9 +85,32 @@ static const proxy_balancer_method bybus + NULL + }; + ++/* post_config hook: */ ++static int lbmethod_bybusyness_post_config(apr_pool_t *pconf, apr_pool_t *plog, ++ apr_pool_t *ptemp, server_rec *s) ++{ ++ ++ /* lbmethod_bybusyness_post_config() will be called twice during startup. So, don't ++ * set up the static data the 1st time through. */ ++ if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG) { ++ return OK; ++ } ++ ++ ap_proxy_balancer_get_best_worker_fn = ++ APR_RETRIEVE_OPTIONAL_FN(ap_proxy_balancer_get_best_worker); ++ if (!ap_proxy_balancer_get_best_worker_fn) { ++ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO() ++ "mod_proxy must be loaded for mod_lbmethod_bybusyness"); ++ return !OK; ++ } ++ ++ return OK; ++} ++ + static void register_hook(apr_pool_t *p) + { + ap_register_provider(p, PROXY_LBMETHOD, "bybusyness", "0", &bybusyness); ++ ap_hook_post_config(lbmethod_bybusyness_post_config, NULL, NULL, APR_HOOK_MIDDLE); + } + + AP_DECLARE_MODULE(lbmethod_bybusyness) = { +--- apache2.orig/modules/proxy/balancers/mod_lbmethod_byrequests.c ++++ apache2/modules/proxy/balancers/mod_lbmethod_byrequests.c +@@ -22,6 +22,9 @@ + + module AP_MODULE_DECLARE_DATA lbmethod_byrequests_module; + ++static APR_OPTIONAL_FN_TYPE(ap_proxy_balancer_get_best_worker) ++ *ap_proxy_balancer_get_best_worker_fn = NULL; ++ + static int is_best_byrequests(proxy_worker *current, proxy_worker *prev_best, void *baton) + { + int *total_factor = (int *)baton; +@@ -81,7 +84,7 @@ static proxy_worker *find_best_byrequest + request_rec *r) + { + int total_factor = 0; +- proxy_worker *worker = ap_proxy_balancer_get_best_worker(balancer, r, is_best_byrequests, &total_factor); ++ proxy_worker *worker = ap_proxy_balancer_get_best_worker_fn(balancer, r, is_best_byrequests, &total_factor); + + if (worker) { + worker->s->lbstatus -= total_factor; +@@ -123,6 +126,28 @@ static const proxy_balancer_method byreq + NULL + }; + ++/* post_config hook: */ ++static int lbmethod_byrequests_post_config(apr_pool_t *pconf, apr_pool_t *plog, ++ apr_pool_t *ptemp, server_rec *s) ++{ ++ ++ /* lbmethod_byrequests_post_config() will be called twice during startup. So, don't ++ * set up the static data the 1st time through. */ ++ if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG) { ++ return OK; ++ } ++ ++ ap_proxy_balancer_get_best_worker_fn = ++ APR_RETRIEVE_OPTIONAL_FN(ap_proxy_balancer_get_best_worker); ++ if (!ap_proxy_balancer_get_best_worker_fn) { ++ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO() ++ "mod_proxy must be loaded for mod_lbmethod_byrequests"); ++ return !OK; ++ } ++ ++ return OK; ++} ++ + static void register_hook(apr_pool_t *p) + { + /* Only the mpm_winnt has child init hook handler. +@@ -130,6 +155,7 @@ static void register_hook(apr_pool_t *p) + * initializes and after the mod_proxy + */ + ap_register_provider(p, PROXY_LBMETHOD, "byrequests", "0", &byrequests); ++ ap_hook_post_config(lbmethod_byrequests_post_config, NULL, NULL, APR_HOOK_MIDDLE); + } + + AP_DECLARE_MODULE(lbmethod_byrequests) = { +--- apache2.orig/modules/proxy/balancers/mod_lbmethod_bytraffic.c ++++ apache2/modules/proxy/balancers/mod_lbmethod_bytraffic.c +@@ -22,6 +22,9 @@ + + module AP_MODULE_DECLARE_DATA lbmethod_bytraffic_module; + ++static APR_OPTIONAL_FN_TYPE(ap_proxy_balancer_get_best_worker) ++ *ap_proxy_balancer_get_best_worker_fn = NULL; ++ + static int is_best_bytraffic(proxy_worker *current, proxy_worker *prev_best, void *baton) + { + apr_off_t *min_traffic = (apr_off_t *)baton; +@@ -59,7 +62,7 @@ static proxy_worker *find_best_bytraffic + { + apr_off_t min_traffic = 0; + +- return ap_proxy_balancer_get_best_worker(balancer, r, is_best_bytraffic, ++ return ap_proxy_balancer_get_best_worker_fn(balancer, r, is_best_bytraffic, + &min_traffic); + } + +@@ -93,6 +96,28 @@ static const proxy_balancer_method bytra + NULL + }; + ++/* post_config hook: */ ++static int lbmethod_bytraffic_post_config(apr_pool_t *pconf, apr_pool_t *plog, ++ apr_pool_t *ptemp, server_rec *s) ++{ ++ ++ /* lbmethod_bytraffic_post_config() will be called twice during startup. So, don't ++ * set up the static data the 1st time through. */ ++ if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG) { ++ return OK; ++ } ++ ++ ap_proxy_balancer_get_best_worker_fn = ++ APR_RETRIEVE_OPTIONAL_FN(ap_proxy_balancer_get_best_worker); ++ if (!ap_proxy_balancer_get_best_worker_fn) { ++ ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO() ++ "mod_proxy must be loaded for mod_lbmethod_bytraffic"); ++ return !OK; ++ } ++ ++ return OK; ++} ++ + static void register_hook(apr_pool_t *p) + { + /* Only the mpm_winnt has child init hook handler. +@@ -100,6 +125,7 @@ static void register_hook(apr_pool_t *p) + * initializes and after the mod_proxy + */ + ap_register_provider(p, PROXY_LBMETHOD, "bytraffic", "0", &bytraffic); ++ ap_hook_post_config(lbmethod_bytraffic_post_config, NULL, NULL, APR_HOOK_MIDDLE); + } + + AP_DECLARE_MODULE(lbmethod_bytraffic) = { +--- apache2.orig/modules/proxy/mod_proxy.h ++++ apache2/modules/proxy/mod_proxy.h +@@ -846,6 +846,14 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_b + request_rec *r, + proxy_is_best_callback_fn_t *is_best, + void *baton); ++/* ++ * Needed by the lb modules. ++ */ ++APR_DECLARE_OPTIONAL_FN(proxy_worker *, ap_proxy_balancer_get_best_worker, ++ (proxy_balancer *balancer, ++ request_rec *r, ++ proxy_is_best_callback_fn_t *is_best, ++ void *baton)); + + /** + * Find the shm of the worker as needed +--- apache2.orig/modules/proxy/proxy_util.c ++++ apache2/modules/proxy/proxy_util.c +@@ -4028,4 +4028,5 @@ void proxy_util_register_hooks(apr_pool_ + { + APR_REGISTER_OPTIONAL_FN(ap_proxy_retry_worker); + APR_REGISTER_OPTIONAL_FN(ap_proxy_clear_connection); ++ APR_REGISTER_OPTIONAL_FN(ap_proxy_balancer_get_best_worker); + }