Read the environment variable EVENTLET_MONKEYPATCH
Since eventlet 0.39.0 [1] it is possible to you set an environment
variable ``EVENTLET_MONKEYPATCH=1`` to get patching as early as
possible in Python startup, which may avoid some problems.
[1]b754135b04
Related-Bug: #2091538
Topic: eventlet-deprecation
Change-Id: I928e32ea736bdb3357fdbb1de6646e69db3159d7
This commit is contained in:

committed by
Rodolfo Alonso

parent
046fd37d9d
commit
5ee7ac1261
@@ -13,6 +13,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
|
||||||
|
|
||||||
@@ -22,6 +24,13 @@ IS_MONKEY_PATCHED = False
|
|||||||
def monkey_patch():
|
def monkey_patch():
|
||||||
global IS_MONKEY_PATCHED
|
global IS_MONKEY_PATCHED
|
||||||
if not IS_MONKEY_PATCHED:
|
if not IS_MONKEY_PATCHED:
|
||||||
|
# This environment variable will be used in eventlet 0.39.0
|
||||||
|
# https://github.com/eventlet/eventlet/commit/
|
||||||
|
# b754135b045306022a537b5797f2cb2cf47ba49b
|
||||||
|
if os.getenv('EVENTLET_MONKEYPATCH') == '1':
|
||||||
|
IS_MONKEY_PATCHED = True
|
||||||
|
return
|
||||||
|
|
||||||
eventlet.monkey_patch()
|
eventlet.monkey_patch()
|
||||||
|
|
||||||
# pylint: disable=import-outside-toplevel
|
# pylint: disable=import-outside-toplevel
|
||||||
|
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Since eventlet 0.39.0, a new environment variable
|
||||||
|
``EVENTLET_MONKEYPATCH=1`` can be defined to get patching as early as
|
||||||
|
possible in Python startup.
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Neutron can read the environment variable ``EVENTLET_MONKEYPATCH=1`` in
|
||||||
|
order to not monkey patch the system libraries. If this environment
|
||||||
|
variable is set and the eventlet version is lower, the process won't be
|
||||||
|
patched.
|
Reference in New Issue
Block a user