Skip to content

Commit be437e9

Browse files
committed
Fix problems connecting to redis sentinel with SSL
1 parent 419b25d commit be437e9

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

fixed-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ python-keyczar==0.716
5050
pytz==2021.1
5151
pywinrm==0.4.1
5252
pyyaml==5.4.1
53-
redis==3.5.3
53+
redis==4.1.4
5454
requests[security]==2.25.1
5555
retrying==1.3.3
5656
routes==2.4.1

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ python-statsd==2.1.0
6060
pytz==2021.1
6161
pywinrm==0.4.1
6262
pyyaml==5.4.1
63-
redis==3.5.3
63+
redis==4.1.4
6464
rednose
6565
requests[security]==2.25.1
6666
retrying==1.3.3

st2common/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pymongo==3.11.3
3535
python-dateutil==2.8.1
3636
python-statsd==2.1.0
3737
pyyaml==5.4.1
38-
redis==3.5.3
38+
redis==4.1.4
3939
requests[security]==2.25.1
4040
retrying==1.3.3
4141
routes==2.4.1

st2common/st2common/util/monkey_patch.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,21 @@ def monkey_patch(patch_thread=None):
4343
patched unless debugger is used.
4444
:type patch_thread: ``bool``
4545
"""
46+
# Eventlet when patched doesn't throw the standard ssl error on timeout, which can break
47+
# some third-party libraries including redis SSL.
48+
# See: https://github.com/eventlet/eventlet/issues/692
49+
# Therefore set the patched ssl module to use the standard socket.timeout exception
50+
from eventlet.green import ssl
4651
import eventlet
52+
from socket import timeout
4753

4854
if patch_thread is None:
4955
patch_thread = not is_use_debugger_flag_provided()
5056

5157
eventlet.monkey_patch(
5258
os=True, select=True, socket=True, thread=patch_thread, time=True
5359
)
60+
ssl.timeout_exc = timeout
5461

5562

5663
def use_select_poll_workaround(nose_only=True):

0 commit comments

Comments
 (0)