Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Adding AsyncRedisSentinelManager #1444

Ithanil started this conversation in Ideas
Mar 21, 2025 · 1 comments · 5 replies
Discussion options

Hi!

During my quest of supporting Redis Sentinel in Open WebUI (open-webui/open-webui#11148) I've created a class AsyncRedisSentinelManager , derived from AsyncRedisManager :

https://github.com/Ithanil/open-webui/blob/e68cd9b6718374f243d94bc2fb62dc4b6db25b08/backend/open_webui/utils/redis.py#L42

It works fine, but of course it would be much more robust to have this supported in python-socketio itself. Would you be open to this?

You must be logged in to vote

Replies: 1 comment · 5 replies

Comment options

Yes, we can incorporate this to this package. I take it from your code that the Redis client does not offer a URL format for Sentinel connections? That would be preferable.

You must be logged in to vote
5 replies
@Ithanil
Comment options

That's great news! But no, AFAIK there is generally not really a standard for Redis Sentinel URLs.

If you look at the beginning of the linked file, you see that outside of the class I use a non-standard Redis URL where the hostname then refers to the Sentinel service (the rest is interpreted as usual) and augment that by a list of Sentinels and port(s). Regarding the latter, I think requiring different ports per Sentinel (but same Redis port) is a strange edge case and thus I personally prefer working with a simple list of Sentinels and a single port as arguments.

Let me know if you want me to work on a PR or rather want to do it yourself.

@miguelgrinberg
Comment options

I'm thinking I will be able to expand the current redis classes to accept redis+sentinel:// style URLs. I'll have a patch ready in a day or two, I'll give you a chance to review and comment.

@Ithanil
Comment options

That sounds like a great solution too. Thanks for taking your time to do this!

@miguelgrinberg
Comment options

PR ready if you want to review it: #1448

Here is an example client manager declaration I'm using in my tests:

client_manager=socketio.AsyncRedisManager(
    'redis+sentinel://:password@localhost:6000,localhost:6001,localhost:6002/0/myprimary'
),

Here myprimary is the redis name for the active master.

@Ithanil
Comment options

@miguelgrinberg Thank you and sorry for the late reply (in my defense, it was weekend ;-) ). I'll try hard to review and test your PR tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.