From 06988b87db3b60de5953d147021e913622b3501e Mon Sep 17 00:00:00 2001 From: Shuicheng Lin Date: Fri, 19 Apr 2019 11:37:55 +0800 Subject: [PATCH] replace python-gunicorn srpm with rpm For the source patch 0001-add-worker-abort-hook.patch, it is not used. For the 3 meta patches, only 0001-TIS-gunicorn-19-upgrade.patch is applied to srpm. And this meta patch just add tis version, and disable python3 compilation. So it is ok to drop all these patches, and use rpm to replace srpm. Story: 2005484 Task: 30578 Depends-On: https://review.opendev.org/653908 Change-Id: I5805cce1dc64dd41be9f415bab985b34791f1506 Signed-off-by: Shuicheng Lin --- centos_iso_image.inc | 3 - centos_pkg_dirs | 1 - python/python-gunicorn/centos/build_srpm.data | 1 - .../0001-TIS-gunicorn-19-upgrade.patch | 118 ------------------ .../meta_patches/0001-TIS-packaging.patch | 25 ---- .../0001-add-worker-abort-patch.patch | 32 ----- .../centos/meta_patches/PATCH_ORDER | 1 - .../patches/0001-add-worker-abort-hook.patch | 92 -------------- python/python-gunicorn/centos/srpm_path | 1 - 9 files changed, 274 deletions(-) delete mode 100644 python/python-gunicorn/centos/build_srpm.data delete mode 100644 python/python-gunicorn/centos/meta_patches/0001-TIS-gunicorn-19-upgrade.patch delete mode 100644 python/python-gunicorn/centos/meta_patches/0001-TIS-packaging.patch delete mode 100644 python/python-gunicorn/centos/meta_patches/0001-add-worker-abort-patch.patch delete mode 100644 python/python-gunicorn/centos/meta_patches/PATCH_ORDER delete mode 100644 python/python-gunicorn/centos/patches/0001-add-worker-abort-hook.patch delete mode 100644 python/python-gunicorn/centos/srpm_path diff --git a/centos_iso_image.inc b/centos_iso_image.inc index ea159fcb6..2f8838890 100644 --- a/centos_iso_image.inc +++ b/centos_iso_image.inc @@ -268,9 +268,6 @@ puppet systemd systemd-config -# python-gunicorn -python2-gunicorn - # tboot tboot diff --git a/centos_pkg_dirs b/centos_pkg_dirs index 95856284c..f51a6ba6b 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -75,7 +75,6 @@ python/python-eventlet python/python-requests base/systemd base/systemd-config -python/python-gunicorn storage-drivers/python-3parclient storage-drivers/python-lefthandclient security/tboot diff --git a/python/python-gunicorn/centos/build_srpm.data b/python/python-gunicorn/centos/build_srpm.data deleted file mode 100644 index 8aeb55368..000000000 --- a/python/python-gunicorn/centos/build_srpm.data +++ /dev/null @@ -1 +0,0 @@ -TIS_PATCH_VER=1 diff --git a/python/python-gunicorn/centos/meta_patches/0001-TIS-gunicorn-19-upgrade.patch b/python/python-gunicorn/centos/meta_patches/0001-TIS-gunicorn-19-upgrade.patch deleted file mode 100644 index d7fb34750..000000000 --- a/python/python-gunicorn/centos/meta_patches/0001-TIS-gunicorn-19-upgrade.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 64d535d3cb2589c36a679ea71e2331e650dde4bb Mon Sep 17 00:00:00 2001 -From: Prajeesh Murukan -Date: Tue, 23 May 2017 12:37:05 -0400 -Subject: [PATCH] WRS: 0001-TIS-gunicorn-19-upgrade.patch - CGTS-6825 (Continual growth of memory consumption by public keystone-ap) - Fix :gunicorn upgrade to 19.7.1 v - - ---- - SPECS/python-gunicorn.spec | 23 ++++++++++++++++++++--- - 1 file changed, 20 insertions(+), 3 deletions(-) - -diff --git a/SPECS/python-gunicorn.spec b/SPECS/python-gunicorn.spec -index b06c1c7..4c19cd5 100644 ---- a/SPECS/python-gunicorn.spec -+++ b/SPECS/python-gunicorn.spec -@@ -3,7 +3,7 @@ - - Name: python-%{upstream_name} - Version: 19.7.1 --Release: 1%{?dist} -+Release: 1.el7%{?_tis_dist}.%{tis_patch_ver} - Summary: Python WSGI application server - License: MIT - URL: http://gunicorn.org/ -@@ -15,6 +15,7 @@ Patch1: deprecate-gaiohttp-worker.patch - Patch101: 0001-use-dev-log-for-syslog.patch - # upstream version requirements are unnecessarily strict - Patch102: 0002-relax-version-requirements.patch -+ - BuildArch: noarch - - %description -@@ -31,7 +32,7 @@ BuildRequires: python2-pytest - BuildRequires: python2-mock - BuildRequires: python2-pytest-cov - BuildRequires: python2-sphinx --BuildRequires: python2-sphinx_rtd_theme -+BuildRequires: python-sphinx_rtd_theme - Requires: python2-setuptools - - %description -n python2-%{upstream_name} -@@ -39,6 +40,7 @@ Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It uses the - pre-fork worker model, ported from Ruby's Unicorn project. It supports WSGI, - Django, and Paster applications. - -+%if 0%{?with_python3} - %package -n python3-%{upstream_name} - Summary: %{summary} - %{?python_provide:%python_provide python3-%{upstream_name}} -@@ -47,11 +49,14 @@ BuildRequires: python3-setuptools - BuildRequires: python3-pytest - BuildRequires: python3-pytest-cov - Requires: python3-setuptools -+%endif - -+%if 0%{?with_python3} - %description -n python3-%{upstream_name} - Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It uses the - pre-fork worker model, ported from Ruby's Unicorn project. It supports WSGI, - Django, and Paster applications. -+%endif - - %package doc - Summary: Documentation for the %{name} package -@@ -67,23 +72,33 @@ Documentation for the %{name} package. - - %build - %py2_build -+ -+%if 0%{?with_python3} - %py3_build -+%endif -+ - %{__python2} setup.py build_sphinx - - %install -+%if 0%{?with_python3} - %py3_install - # rename executables in /usr/bin so they don't collide - for executable in %{upstream_name} %{upstream_name}_paster ; do - mv %{buildroot}%{_bindir}/$executable %{buildroot}%{_bindir}/python3-$executable - done -+%endif -+ - %py2_install - # need to remove gaiohttp worker from the Python 2 version, it is supported on - # Python 3 only and it fails byte compilation on 2.x due to using "yield from" - rm %{buildroot}%{python2_sitelib}/%{upstream_name}/workers/_gaiohttp.py* - - %check --%{__python2} setup.py test -+#%{__python2} setup.py test -+ -+%if 0%{?with_python3} - %{__python3} setup.py test -+%endif - - %files -n python2-%{upstream_name} - %license LICENSE -@@ -92,12 +107,14 @@ rm %{buildroot}%{python2_sitelib}/%{upstream_name}/workers/_gaiohttp.py* - %{_bindir}/%{upstream_name} - %{_bindir}/%{upstream_name}_paster - -+%if 0%{?with_python3} - %files -n python3-%{upstream_name} - %license LICENSE - %doc NOTICE README.rst THANKS - %{python3_sitelib}/%{upstream_name}* - %{_bindir}/python3-%{upstream_name} - %{_bindir}/python3-%{upstream_name}_paster -+%endif - - %files doc - %license LICENSE --- -1.8.3.1 -i diff --git a/python/python-gunicorn/centos/meta_patches/0001-TIS-packaging.patch b/python/python-gunicorn/centos/meta_patches/0001-TIS-packaging.patch deleted file mode 100644 index eadc82978..000000000 --- a/python/python-gunicorn/centos/meta_patches/0001-TIS-packaging.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 1f7502ce81b5b662728a21618009802f4bfa47d2 Mon Sep 17 00:00:00 2001 -From: Giao Le -Date: Mon, 21 Nov 2016 15:27:34 -0500 -Subject: [PATCH 1/1] TIS packaging - ---- - SPECS/python-gunicorn.spec | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/SPECS/python-gunicorn.spec b/SPECS/python-gunicorn.spec -index 2da7590..86b6667 100644 ---- a/SPECS/python-gunicorn.spec -+++ b/SPECS/python-gunicorn.spec -@@ -7,7 +7,7 @@ - - Name: python-%{upstream_name} - Version: 18.0 --Release: 2%{?dist} -+Release: 2.el7%{?_tis_dist}.%{tis_patch_ver} - Summary: Python WSGI application server - - Group: System Environment/Daemons --- -1.8.3.1 - diff --git a/python/python-gunicorn/centos/meta_patches/0001-add-worker-abort-patch.patch b/python/python-gunicorn/centos/meta_patches/0001-add-worker-abort-patch.patch deleted file mode 100644 index 5b57db293..000000000 --- a/python/python-gunicorn/centos/meta_patches/0001-add-worker-abort-patch.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b0ad59c3a7992b5f171e8252cd02d1d207601f6a Mon Sep 17 00:00:00 2001 -From: Giao Le -Date: Tue, 22 Nov 2016 12:53:18 -0500 -Subject: [PATCH 1/1] add-worker-work-patch - ---- - SPECS/python-gunicorn.spec | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/SPECS/python-gunicorn.spec b/SPECS/python-gunicorn.spec -index 86b6667..acd6b90 100644 ---- a/SPECS/python-gunicorn.spec -+++ b/SPECS/python-gunicorn.spec -@@ -16,6 +16,7 @@ URL: http://gunicorn.org/ - Source0: http://pypi.python.org/packages/source/g/%{upstream_name}/%{upstream_name}-%{version}.tar.gz - # distro-specific, not upstreamable - Patch100: %{name}-dev-log.patch -+Patch200: 0001-add-worker-abort-hook.patch - - BuildArch: noarch - BuildRequires: python2-devel -@@ -48,6 +49,7 @@ Django, and Paster applications. - %prep - %setup -q -n %{upstream_name}-%{version} - %patch100 -p1 -+%patch200 -p1 - - %if 0%{?with_python3} - rm -rf %{py3dir} --- -1.8.3.1 - diff --git a/python/python-gunicorn/centos/meta_patches/PATCH_ORDER b/python/python-gunicorn/centos/meta_patches/PATCH_ORDER deleted file mode 100644 index 108d333f4..000000000 --- a/python/python-gunicorn/centos/meta_patches/PATCH_ORDER +++ /dev/null @@ -1 +0,0 @@ -0001-TIS-gunicorn-19-upgrade.patch diff --git a/python/python-gunicorn/centos/patches/0001-add-worker-abort-hook.patch b/python/python-gunicorn/centos/patches/0001-add-worker-abort-hook.patch deleted file mode 100644 index b4ddbc6b7..000000000 --- a/python/python-gunicorn/centos/patches/0001-add-worker-abort-hook.patch +++ /dev/null @@ -1,92 +0,0 @@ -From d78a84dc692f708afd90df3409f9e264c22231dd Mon Sep 17 00:00:00 2001 -From: Giao Le -Date: Tue, 22 Nov 2016 10:18:14 -0500 -Subject: [PATCH 1/1] add worker abort hook - ---- - gunicorn/arbiter.py | 9 +++++++-- - gunicorn/config.py | 18 ++++++++++++++++++ - gunicorn/workers/base.py | 7 +++++++ - 3 files changed, 32 insertions(+), 2 deletions(-) - -diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py -index b48e5b7..4d2daad 100644 ---- a/gunicorn/arbiter.py -+++ b/gunicorn/arbiter.py -@@ -429,8 +429,13 @@ class Arbiter(object): - except ValueError: - continue - -- self.log.critical("WORKER TIMEOUT (pid:%s)", pid) -- self.kill_worker(pid, signal.SIGKILL) -+ if not worker.aborted: -+ self.log.critical("WORKER TIMEOUT (pid:%s)", pid) -+ worker.aborted = True -+ self.kill_worker(pid, signal.SIGABRT) -+ else: -+ self.kill_worker(pid, signal.SIGKILL) -+ - - def reap_workers(self): - """\ -diff --git a/gunicorn/config.py b/gunicorn/config.py -index efcc449..3aec7ae 100644 ---- a/gunicorn/config.py -+++ b/gunicorn/config.py -@@ -1282,6 +1282,24 @@ class PostWorkerInit(Setting): - """ - - -+class WorkerAbort(Setting): -+ name = "worker_abort" -+ section = "Server Hooks" -+ validator = validate_callable(1) -+ type = six.callable -+ -+ def worker_abort(worker): -+ pass -+ -+ default = staticmethod(worker_abort) -+ desc = """\ -+ Called when a worker received the SIGABRT signal. -+ This call generally happens on timeout. -+ The callable needs to accept one instance variable for the initialized -+ Worker. -+ """ -+ -+ - class PreExec(Setting): - name = "pre_exec" - section = "Server Hooks" -diff --git a/gunicorn/workers/base.py b/gunicorn/workers/base.py -index 5566dd1..af785a1 100644 ---- a/gunicorn/workers/base.py -+++ b/gunicorn/workers/base.py -@@ -40,6 +40,7 @@ class Worker(object): - self.timeout = timeout - self.cfg = cfg - self.booted = False -+ self.aborted = False - - self.nr = 0 - self.max_requests = cfg.max_requests or MAXSIZE -@@ -120,6 +121,7 @@ class Worker(object): - signal.signal(signal.SIGINT, self.handle_exit) - signal.signal(signal.SIGWINCH, self.handle_winch) - signal.signal(signal.SIGUSR1, self.handle_usr1) -+ signal.signal(signal.SIGABRT, self.handle_abort) - # Don't let SIGQUIT and SIGUSR1 disturb active requests - # by interrupting system calls - if hasattr(signal, 'siginterrupt'): # python >= 2.6 -@@ -202,3 +204,8 @@ class Worker(object): - def handle_winch(self, sig, fname): - # Ignore SIGWINCH in worker. Fixes a crash on OpenBSD. - return -+ -+ def handle_abort(self, sig, frame): -+ self.alive = False -+ self.cfg.worker_abort(self) -+ sys.exit(1) --- -1.8.3.1 - diff --git a/python/python-gunicorn/centos/srpm_path b/python/python-gunicorn/centos/srpm_path deleted file mode 100644 index 341ecdaf1..000000000 --- a/python/python-gunicorn/centos/srpm_path +++ /dev/null @@ -1 +0,0 @@ -mirror:Source/python-gunicorn-19.7.1-1.fc27.src.rpm