Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues when using redis sentinel with possible fix #307

Closed
bwatIT opened this issue Jun 12, 2019 · 1 comment
Closed

Issues when using redis sentinel with possible fix #307

bwatIT opened this issue Jun 12, 2019 · 1 comment
Assignees

Comments

@bwatIT
Copy link

bwatIT commented Jun 12, 2019

Hello, I don't typically submit issues however for a project I am working on, we are leveraging socketio with redis sentinel as the broker and happened to have difficulties getting this working.

My setup:
python-socketio (3.1.2)
redis-sentinel v4.0.9

The issue: When using standard redis as the broker, the setup seems to work fine. Multiple nodes can connect to the broker and all is well.

In my QA/Prod we are using Redis Sentinel and it seems the socketio does not handle sentinel natively and passes the buck to Kombu to manage/setup. Kombu appears to support redis sentinel however it will need the redis sentinel master_name in order to leverage the broker, per the _connection method in socketio/kombu_manager.py, however there isn't a hook into that currently.

I was able to get this working by passing the master_name to Kombu via the transport_options below and get Redis Sentinel working, however I would like to pass this via the SocketIO setup options.

My hacky patch to get working:
file - socketio/kombu_manager.py
line - 67
def _connection(self): transport_options = {'master_name' : 'OUR_MASTER_NAME_HERE'} return kombu.Connection(self.url, transport_options=transport_options)

Please let me know if any additional information is required and I'd be happy to provide what I can.

Thanks!

@miguelgrinberg
Copy link
Owner

Yes, I agree, there should be a way to pass these options. It's a pity that there is no way to pass this argument as part of the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants