summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/recipes-devtools/python/python3-gunicorn/eventlet-worker-ALREADY_HANDLED-WSGI_LOCAL.patch54
-rw-r--r--meta-python/recipes-devtools/python/python3-gunicorn_20.1.0.bb3
2 files changed, 56 insertions, 1 deletions
diff --git a/meta-python/recipes-devtools/python/python3-gunicorn/eventlet-worker-ALREADY_HANDLED-WSGI_LOCAL.patch b/meta-python/recipes-devtools/python/python3-gunicorn/eventlet-worker-ALREADY_HANDLED-WSGI_LOCAL.patch
new file mode 100644
index 0000000000..d385423445
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-gunicorn/eventlet-worker-ALREADY_HANDLED-WSGI_LOCAL.patch
@@ -0,0 +1,54 @@
1From 6a8ebb4844b2f28596ffe7421eb9f7d08c8dc4d8 Mon Sep 17 00:00:00 2001
2From: Sergey Shepelev <temotor@gmail.com>
3Date: Thu, 6 May 2021 12:54:06 +0300
4Subject: [PATCH] eventlet worker: ALREADY_HANDLED -> WSGI_LOCAL
5
6Eventlet v0.30.3+ removed wsgi.ALREADY_HANDLED in favor of
7`wsgi.WSGI_LOCAL.already_handled: bool`
8
9Sorry, this breaking change happened during only patch
10version increase 0.30.2 -> 0.30.3
11
12https://github.com/eventlet/eventlet/issues/543
13https://github.com/eventlet/eventlet/pull/544
14
15Upstream-Status: Backport [https://github.com/benoitc/gunicorn/commit/6a8ebb4844b2f28596ffe7421eb9f7d08c8dc4d8]
16Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
17
18---
19 gunicorn/workers/geventlet.py | 11 ++++++++++-
20 1 file changed, 10 insertions(+), 1 deletion(-)
21
22diff --git a/gunicorn/workers/geventlet.py b/gunicorn/workers/geventlet.py
23index ffdb206c0..ea82f3d62 100644
24--- a/gunicorn/workers/geventlet.py
25+++ b/gunicorn/workers/geventlet.py
26@@ -17,11 +17,16 @@
27
28 from eventlet import hubs, greenthread
29 from eventlet.greenio import GreenSocket
30-from eventlet.wsgi import ALREADY_HANDLED as EVENTLET_ALREADY_HANDLED
31+import eventlet.wsgi
32 import greenlet
33
34 from gunicorn.workers.base_async import AsyncWorker
35
36+# ALREADY_HANDLED is removed in 0.30.3+ now it's `WSGI_LOCAL.already_handled: bool`
37+# https://github.com/eventlet/eventlet/pull/544
38+EVENTLET_WSGI_LOCAL = getattr(eventlet.wsgi, "WSGI_LOCAL", None)
39+EVENTLET_ALREADY_HANDLED = getattr(eventlet.wsgi, "ALREADY_HANDLED", None)
40+
41
42 def _eventlet_socket_sendfile(self, file, offset=0, count=None):
43 # Based on the implementation in gevent which in turn is slightly
44@@ -125,6 +130,10 @@ def patch(self):
45 patch_sendfile()
46
47 def is_already_handled(self, respiter):
48+ # eventlet >= 0.30.3
49+ if getattr(EVENTLET_WSGI_LOCAL, "already_handled", None):
50+ raise StopIteration()
51+ # eventlet < 0.30.3
52 if respiter == EVENTLET_ALREADY_HANDLED:
53 raise StopIteration()
54 return super().is_already_handled(respiter)
diff --git a/meta-python/recipes-devtools/python/python3-gunicorn_20.1.0.bb b/meta-python/recipes-devtools/python/python3-gunicorn_20.1.0.bb
index f381b9df2b..903e054d34 100644
--- a/meta-python/recipes-devtools/python/python3-gunicorn_20.1.0.bb
+++ b/meta-python/recipes-devtools/python/python3-gunicorn_20.1.0.bb
@@ -9,12 +9,13 @@ inherit pypi setuptools3 ptest
9 9
10SRC_URI += " \ 10SRC_URI += " \
11 file://run-ptest \ 11 file://run-ptest \
12 file://eventlet-worker-ALREADY_HANDLED-WSGI_LOCAL.patch \
12" 13"
13 14
14RDEPENDS:${PN}-ptest += " \ 15RDEPENDS:${PN}-ptest += " \
15 ${PYTHON_PN}-eventlet \ 16 ${PYTHON_PN}-eventlet \
16 ${PYTHON_PN}-gevent \ 17 ${PYTHON_PN}-gevent \
17 ${PYTHON_PN}-pytest \ 18 ${PYTHON_PN}-pytest \
18" 19"
19 20
20do_install_ptest() { 21do_install_ptest() {