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 <shuicheng.lin@intel.com>
This commit is contained in:
Shuicheng Lin 2019-04-19 11:37:55 +08:00 committed by Lin Shuicheng
parent 9dd08ab5b8
commit 06988b87db
9 changed files with 0 additions and 274 deletions

View File

@ -268,9 +268,6 @@ puppet
systemd
systemd-config
# python-gunicorn
python2-gunicorn
# tboot
tboot

View File

@ -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

View File

@ -1 +0,0 @@
TIS_PATCH_VER=1

View File

@ -1,118 +0,0 @@
From 64d535d3cb2589c36a679ea71e2331e650dde4bb Mon Sep 17 00:00:00 2001
From: Prajeesh Murukan <prajeesh.murukan@windriver.com>
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

View File

@ -1,25 +0,0 @@
From 1f7502ce81b5b662728a21618009802f4bfa47d2 Mon Sep 17 00:00:00 2001
From: Giao Le <giao.le@windriver.com>
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

View File

@ -1,32 +0,0 @@
From b0ad59c3a7992b5f171e8252cd02d1d207601f6a Mon Sep 17 00:00:00 2001
From: Giao Le <giao.le@windriver.com>
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

View File

@ -1 +0,0 @@
0001-TIS-gunicorn-19-upgrade.patch

View File

@ -1,92 +0,0 @@
From d78a84dc692f708afd90df3409f9e264c22231dd Mon Sep 17 00:00:00 2001
From: Giao Le <giao.le@windriver.com>
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

View File

@ -1 +0,0 @@
mirror:Source/python-gunicorn-19.7.1-1.fc27.src.rpm