From 0a2b98db54ae0943561ae31334750f97975b5842cfc1b7a2c2ba94ccb4aaf725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=98=D0=BD=D0=B4=D0=B8=D0=B3?= =?UTF-8?q?=D0=BE?= Date: Sat, 27 Feb 2021 11:04:31 +0000 Subject: [PATCH] Accepting request 875591 from home:darix:apps - Drop nginx_upstream_check module, there is no support for dynamic loading upstream and the module seems kind of unmaintained. OBS-URL: https://build.opensuse.org/request/show/875591 OBS-URL: https://build.opensuse.org/package/show/server:http/nginx?expand=0&rev=190 --- check_1.9.2+.patch | 242 ----------------------- nginx.changes | 6 + nginx.spec | 24 +-- nginx_upstream_check_module-0.3.0.tar.gz | 3 - 4 files changed, 8 insertions(+), 267 deletions(-) delete mode 100644 check_1.9.2+.patch delete mode 100644 nginx_upstream_check_module-0.3.0.tar.gz diff --git a/check_1.9.2+.patch b/check_1.9.2+.patch deleted file mode 100644 index 17e0e84..0000000 --- a/check_1.9.2+.patch +++ /dev/null @@ -1,242 +0,0 @@ -Index: src/http/modules/ngx_http_upstream_hash_module.c -=================================================================== ---- src/http/modules/ngx_http_upstream_hash_module.c.orig -+++ src/http/modules/ngx_http_upstream_hash_module.c -@@ -9,6 +9,9 @@ - #include - #include - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+#include "ngx_http_upstream_check_module.h" -+#endif - - typedef struct { - uint32_t hash; -@@ -238,6 +241,15 @@ ngx_http_upstream_get_hash_peer(ngx_peer - goto next; - } - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get hash peer, check_index: %ui", -+ peer->check_index); -+ if (ngx_http_upstream_check_peer_down(peer->check_index)) { -+ goto next; -+ } -+#endif -+ - if (peer->max_fails - && peer->fails >= peer->max_fails - && now - peer->checked <= peer->fail_timeout) -@@ -560,6 +572,15 @@ ngx_http_upstream_get_chash_peer(ngx_pee - continue; - } - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get consistent_hash peer, check_index: %ui", -+ peer->check_index); -+ if (ngx_http_upstream_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (peer->server.len != server->len - || ngx_strncmp(peer->server.data, server->data, server->len) - != 0) -Index: src/http/modules/ngx_http_upstream_ip_hash_module.c -=================================================================== ---- src/http/modules/ngx_http_upstream_ip_hash_module.c.orig -+++ src/http/modules/ngx_http_upstream_ip_hash_module.c -@@ -9,6 +9,9 @@ - #include - #include - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+#include "ngx_http_upstream_check_module.h" -+#endif - - typedef struct { - /* the round robin data must be first */ -@@ -208,6 +211,15 @@ ngx_http_upstream_get_ip_hash_peer(ngx_p - goto next; - } - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get ip_hash peer, check_index: %ui", -+ peer->check_index); -+ if (ngx_http_upstream_check_peer_down(peer->check_index)) { -+ goto next; -+ } -+#endif -+ - if (peer->max_fails - && peer->fails >= peer->max_fails - && now - peer->checked <= peer->fail_timeout) -Index: src/http/modules/ngx_http_upstream_least_conn_module.c -=================================================================== ---- src/http/modules/ngx_http_upstream_least_conn_module.c.orig -+++ src/http/modules/ngx_http_upstream_least_conn_module.c -@@ -9,6 +9,9 @@ - #include - #include - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+#include "ngx_http_upstream_check_module.h" -+#endif - - static ngx_int_t ngx_http_upstream_init_least_conn_peer(ngx_http_request_t *r, - ngx_http_upstream_srv_conf_t *us); -@@ -147,6 +150,16 @@ ngx_http_upstream_get_least_conn_peer(ng - continue; - } - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get least_conn peer, check_index: %ui", -+ peer->check_index); -+ -+ if (ngx_http_upstream_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (peer->max_fails - && peer->fails >= peer->max_fails - && now - peer->checked <= peer->fail_timeout) -@@ -202,6 +215,16 @@ ngx_http_upstream_get_least_conn_peer(ng - continue; - } - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get least_conn peer, check_index: %ui", -+ peer->check_index); -+ -+ if (ngx_http_upstream_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (peer->conns * best->weight != best->conns * peer->weight) { - continue; - } -Index: src/http/ngx_http_upstream_round_robin.c -=================================================================== ---- src/http/ngx_http_upstream_round_robin.c.orig -+++ src/http/ngx_http_upstream_round_robin.c -@@ -9,6 +9,9 @@ - #include - #include - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+#include "ngx_http_upstream_check_module.h" -+#endif - - #define ngx_http_upstream_tries(p) ((p)->number \ - + ((p)->next ? (p)->next->number : 0)) -@@ -97,7 +100,14 @@ ngx_http_upstream_init_round_robin(ngx_c - peer[n].fail_timeout = server[i].fail_timeout; - peer[n].down = server[i].down; - peer[n].server = server[i].name; -- -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ if (!server[i].down) { -+ peer[n].check_index = -+ ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]); -+ } else { -+ peer[n].check_index = (ngx_uint_t) NGX_ERROR; -+ } -+#endif - *peerp = &peer[n]; - peerp = &peer[n].next; - n++; -@@ -161,7 +171,15 @@ ngx_http_upstream_init_round_robin(ngx_c - peer[n].fail_timeout = server[i].fail_timeout; - peer[n].down = server[i].down; - peer[n].server = server[i].name; -- -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ if (!server[i].down) { -+ peer[n].check_index = -+ ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]); -+ } -+ else { -+ peer[n].check_index = (ngx_uint_t) NGX_ERROR; -+ } -+#endif - *peerp = &peer[n]; - peerp = &peer[n].next; - n++; -@@ -228,6 +246,9 @@ ngx_http_upstream_init_round_robin(ngx_c - peer[i].max_conns = 0; - peer[i].max_fails = 1; - peer[i].fail_timeout = 10; -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ peer[i].check_index = (ngx_uint_t) NGX_ERROR; -+#endif - *peerp = &peer[i]; - peerp = &peer[i].next; - } -@@ -344,6 +365,9 @@ ngx_http_upstream_create_round_robin_pee - peer[0].max_conns = 0; - peer[0].max_fails = 1; - peer[0].fail_timeout = 10; -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ peer[0].check_index = (ngx_uint_t) NGX_ERROR; -+#endif - peers->peer = peer; - - } else { -@@ -378,6 +402,9 @@ ngx_http_upstream_create_round_robin_pee - peer[i].max_conns = 0; - peer[i].max_fails = 1; - peer[i].fail_timeout = 10; -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ peer[i].check_index = (ngx_uint_t) NGX_ERROR; -+#endif - *peerp = &peer[i]; - peerp = &peer[i].next; - } -@@ -443,6 +470,12 @@ ngx_http_upstream_get_round_robin_peer(n - goto failed; - } - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ if (ngx_http_upstream_check_peer_down(peer->check_index)) { -+ goto failed; -+ } -+#endif -+ - rrp->current = peer; - - } else { -@@ -537,6 +570,12 @@ ngx_http_upstream_get_peer(ngx_http_upst - continue; - } - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ if (ngx_http_upstream_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (peer->max_fails - && peer->fails >= peer->max_fails - && now - peer->checked <= peer->fail_timeout) -Index: src/http/ngx_http_upstream_round_robin.h -=================================================================== ---- src/http/ngx_http_upstream_round_robin.h.orig -+++ src/http/ngx_http_upstream_round_robin.h -@@ -38,6 +38,10 @@ struct ngx_http_upstream_rr_peer_s { - ngx_msec_t slow_start; - ngx_msec_t start_time; - -+#if (NGX_HTTP_UPSTREAM_CHECK) -+ ngx_uint_t check_index; -+#endif -+ - ngx_uint_t down; - - #if (NGX_HTTP_SSL || NGX_COMPAT) diff --git a/nginx.changes b/nginx.changes index 76f8503..33e7d69 100644 --- a/nginx.changes +++ b/nginx.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Feb 17 00:02:08 UTC 2021 - Marcus Rueckert + +- Drop nginx_upstream_check module, there is no support for dynamic + loading upstream and the module seems kind of unmaintained. + ------------------------------------------------------------------- Tue Feb 16 23:40:16 UTC 2021 - Marcus Rueckert diff --git a/nginx.spec b/nginx.spec index b3f208d..2f42dcb 100644 --- a/nginx.spec +++ b/nginx.spec @@ -18,14 +18,7 @@ %{!?vim_data_dir:%global vim_data_dir %{_datadir}/vim/%(readlink %{_datadir}/vim/current)} %define pkg_name nginx -%define nginx_upstream_check_version 0.3.0 -%define nginx_upstream_check_module_path nginx_upstream_check_module-%{nginx_upstream_check_version} %define src_install_dir %{_prefix}/src/%{name} -%if 0%{?is_opensuse} -%bcond_without extra_modules -%else -%bcond_with extra_modules -%endif # keep in sync with %ngx_conditionals %bcond_with ngx_cpp_test %bcond_with ngx_google_perftools @@ -43,7 +36,6 @@ Source0: https://nginx.org/download/%{name}-%{version}.tar.gz Source1: nginx.init Source2: nginx.logrotate Source3: nginx.service -Source4: https://github.com/yaoweibin/nginx_upstream_check_module/archive/v%{nginx_upstream_check_version}/%{nginx_upstream_check_module_path}.tar.gz Source9: nginx.sysusers Source100: nginx.rpmlintrc Source101: https://nginx.org/download/%{name}-%{version}.tar.gz.asc @@ -59,8 +51,6 @@ Patch3: nginx-1.6.1-default_config.patch # PATCH-FIX-UPSTREAM nginx-aio.patch fix support for Linux AIO Patch4: nginx-aio.patch # PATCH-FIX-UPSTREAM check_1.9.2+.patch -Patch5: check_1.9.2+.patch -# keep Buildrequires for the libraries and everything in sync with the requires in the nginx-source package BuildRequires: gcc-c++ BuildRequires: gd-devel BuildRequires: libxslt-devel @@ -131,15 +121,12 @@ Requires: libatomic-ops-devel The source of nginx [engine x] HTTP server and IMAP/POP3 proxy server. %prep -%setup -q -n %{pkg_name}-%{version} -a 4 +%setup -q -n %{pkg_name}-%{version} %patch0 -p1 %patch1 -p1 %patch2 %patch3 %patch4 -p1 -%if %{with ngx_extra_modules} -%patch5 -%endif perl -pi -e 's|\r\n|\n|g' contrib/geo2nginx.pl # we just use lib here because nginx loads them relative to _prefix @@ -152,11 +139,7 @@ sed -i "s/\/var\/run/\/run/" conf/nginx.conf sed -i 's/^\(#define NGX_LISTEN_BACKLOG \).*/\1-1/' src/os/unix/ngx_linux_config.h %build -# FIXME: you should use the %%configure macro -%{ngx_configure} \ - %if %{with ngx_extra_modules} - --add-module=%{nginx_upstream_check_module_path} \ - %endif +%{ngx_configure} %make_build %sysusers_generate_pre %{SOURCE9} nginx @@ -203,9 +186,6 @@ copydocs() { popd } -copydocs %{nginx_upstream_check_module_path} \ - doc/* - %pre -f nginx.pre %service_add_pre nginx.service diff --git a/nginx_upstream_check_module-0.3.0.tar.gz b/nginx_upstream_check_module-0.3.0.tar.gz deleted file mode 100644 index 74a6f49..0000000 --- a/nginx_upstream_check_module-0.3.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c543bf427b38643c10dcd1a0c701392bc666708313e7b63f9272396a6cc9a461 -size 136542