diff options
author | Michael Johnson <johnsomor@gmail.com> | 2022-09-07 18:40:24 +0000 |
---|---|---|
committer | Michael Johnson <johnsomor@gmail.com> | 2022-09-14 16:11:36 +0000 |
commit | 1787dd8674da6922b0cdb20962a6e874e59fb973 (patch) | |
tree | 1c650b669747988fcfb9807c8ab1453be4cba78f | |
parent | f674574fe7b9fe170af1ec0e170ed01bb0e19b79 (diff) | |
download | designate-1787dd8674da6922b0cdb20962a6e874e59fb973.tar.gz |
Fix Redis connection over TLS
When Designate is configured to use Redis for coordination over a TLS connection, it will fail to connect with "ssl.SSLError: ('timed out',)".
This is caused by eventlet raising ssl.SSLError instead of the expected socket timeout the core libraries return.
This patch monkey-patches eventlet to return the proper exception.
Closes-Bug: #1989020
Change-Id: I5bd1c10d863212683752e05bb450e6f531ff7e72
(cherry picked from commit 93dee6a3ff44fb7470b3008e8fbbaf99822bbe82)
-rw-r--r-- | designate/cmd/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/designate/cmd/__init__.py b/designate/cmd/__init__.py index 3a7edfa9..a899ed3a 100644 --- a/designate/cmd/__init__.py +++ b/designate/cmd/__init__.py @@ -14,8 +14,15 @@ # License for the specific language governing permissions and limitations # under the License. import eventlet +from eventlet.green import ssl +import socket eventlet.monkey_patch(os=False) + +# Work around the eventlet issue that impacts redis using TLS. +# https://github.com/eventlet/eventlet/issues/692 +ssl.timeout_exc = socket.timeout + # Monkey patch the original current_thread to use the up-to-date _active # global variable. See https://bugs.launchpad.net/bugs/1863021 and # https://github.com/eventlet/eventlet/issues/592 |