Merge "Correctly disable greendns"

This commit is contained in:
Zuul 2020-09-13 21:30:07 +00:00 committed by Gerrit Code Review
commit 7688bc0309
1 changed files with 13 additions and 10 deletions

View File

@ -22,6 +22,19 @@ import os
def _monkey_patch(): def _monkey_patch():
# See https://bugs.launchpad.net/nova/+bug/1164822
# TODO(mdbooth): This feature was deprecated and removed in eventlet at
# some point but brought back in version 0.21.0, presumably because some
# users still required it to work round issues. However, there have been a
# number of greendns fixes in eventlet since then. Specifically, it looks
# as though the originally reported IPv6 issue may have been fixed in
# version 0.24.0. We should remove this when we can confirm that the
# original issue is fixed.
# NOTE(artom) eventlet processes environment variables at import-time. We
# therefore set this here, before importing eventlet, in order to correctly
# disable greendns.
os.environ['EVENTLET_NO_GREENDNS'] = 'yes'
# NOTE(mdbooth): Anything imported here will not be monkey patched. It is # NOTE(mdbooth): Anything imported here will not be monkey patched. It is
# important to take care not to import anything here which requires monkey # important to take care not to import anything here which requires monkey
# patching. # patching.
@ -39,16 +52,6 @@ def _monkey_patch():
problems = (set(['urllib3', 'oslo_context.context']) & problems = (set(['urllib3', 'oslo_context.context']) &
set(sys.modules.keys())) set(sys.modules.keys()))
# See https://bugs.launchpad.net/nova/+bug/1164822
# TODO(mdbooth): This feature was deprecated and removed in eventlet at
# some point but brought back in version 0.21.0, presumably because some
# users still required it to work round issues. However, there have been a
# number of greendns fixes in eventlet since then. Specifically, it looks
# as though the originally reported IPv6 issue may have been fixed in
# version 0.24.0. We should remove this when we can confirm that the
# original issue is fixed.
os.environ['EVENTLET_NO_GREENDNS'] = 'yes'
if debugger.enabled(): if debugger.enabled():
# turn off thread patching to enable the remote debugger # turn off thread patching to enable the remote debugger
eventlet.monkey_patch(thread=False) eventlet.monkey_patch(thread=False)