summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Mooney <work@seanmooney.info>2022-02-25 11:09:50 +0000
committerSean Mooney <work@seanmooney.info>2022-03-11 16:20:06 +0000
commitedb8bcb0294fb1488c49ad76f2422378d0c495eb (patch)
tree364f95238b7f1705cb471afbbeb78323f1be3921
parentcb935a313961721839c574d7dcba5568ada9b195 (diff)
downloadnova-edb8bcb0294fb1488c49ad76f2422378d0c495eb.tar.gz
reenable greendns in nova.
Back in the days of centos 6 and python 2.6 eventlet greendns monkeypatching broke ipv6. As a result nova has run without greendns monkey patching ever since. This removes that old workaround allowing modern eventlet to use greendns for non blocking dns lookups. Closes-Bug: #1964149 Change-Id: Ia511879d2f5f50a3f63d180258abccf046a7264e (cherry picked from commit fe1ebe69f358cbed62434da3f1537a94390324bb) (cherry picked from commit a913ab1aabb827771e54ef64b579cebe44ad53d1)
-rw-r--r--nova/monkey_patch.py15
-rw-r--r--nova/tests/functional/test_monkey_patch.py45
-rw-r--r--releasenotes/notes/greendns-34df7f9fba952bcd.yaml14
3 files changed, 16 insertions, 58 deletions
diff --git a/nova/monkey_patch.py b/nova/monkey_patch.py
index 3c96a433d5..6bcd9017a9 100644
--- a/nova/monkey_patch.py
+++ b/nova/monkey_patch.py
@@ -22,22 +22,11 @@ import os
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
# important to take care not to import anything here which requires monkey
# patching.
+ # NOTE(artom) eventlet processes environment variables at import-time.
+ # as such any eventlet configuration should happen here if needed.
import eventlet
import sys
diff --git a/nova/tests/functional/test_monkey_patch.py b/nova/tests/functional/test_monkey_patch.py
deleted file mode 100644
index b471d333cf..0000000000
--- a/nova/tests/functional/test_monkey_patch.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2020 Red Hat, Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-# NOTE(artom) This file exists to test eventlet monkeypatching. How and what
-# eventlet monkeypatches can be controlled by environment variables that
-# are processed by eventlet at import-time (for exmaple, EVENTLET_NO_GREENDNS).
-# Nova manages all of this in nova.monkey_patch. Therefore, nova.monkey_patch
-# must be the first thing to import eventlet. As nova.tests.functional.__init__
-# imports nova.monkey_patch, we're OK here.
-
-import socket
-import traceback
-
-from nova import test
-
-
-class TestMonkeyPatch(test.TestCase):
-
- def test_greendns_is_disabled(self):
- """Try to resolve a fake fqdn. If we see greendns mentioned in the
- traceback of the raised exception, it means we've not actually disabled
- greendns. See the TODO and NOTE in nova.monkey_patch to understand why
- greendns needs to be disabled.
- """
- raised = False
- try:
- socket.gethostbyname('goat.fake')
- except Exception:
- tb = traceback.format_exc()
- # NOTE(artom) If we've correctly disabled greendns, we expect the
- # traceback to not contain any reference to it.
- self.assertNotIn('greendns.py', tb)
- raised = True
- self.assertTrue(raised)
diff --git a/releasenotes/notes/greendns-34df7f9fba952bcd.yaml b/releasenotes/notes/greendns-34df7f9fba952bcd.yaml
new file mode 100644
index 0000000000..d42795747c
--- /dev/null
+++ b/releasenotes/notes/greendns-34df7f9fba952bcd.yaml
@@ -0,0 +1,14 @@
+---
+fixes:
+ - |
+ During the havana cycle it was discovered that eventlet
+ monkey patching of greendns broke ipv6.
+ https://bugs.launchpad.net/nova/+bug/1164822
+ Since then nova has been disabling eventlet monkey patching
+ of greendns. Eventlet adressed the ipv6 limitation in v0.17
+ with the introduction of python 3 support in 2015. Nova
+ however continued to disable it, which can result i slow dns
+ queries blocking the entire nova api or other binary
+ because socket.getaddrinfo becomes a blocking call into glibc
+ see: https://bugs.launchpad.net/nova/+bug/1964149 for
+ more details.