[PR #20746] [CLOSED] fix: Support RedisCluster for task command pub/sub messaging (#19840) #25759

Closed
opened 2026-04-20 06:06:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20746
Author: @YuriNachos
Created: 1/17/2026
Status: Closed

Base: mainHead: fix-rediscluster-publish


📝 Commits (6)

  • f84aad5 fix: handle None value for model capabilities in builtin_tools check
  • 0d4898f fix: handle None value for model capabilities in file_context check
  • 9772be0 fix: handle None value for capabilities in get_model_capability helper
  • 3d404ff fix: URL-encode OAuth client secrets to handle special characters
  • 3079444 fix: Decode HTML entities in tool call results before sending to LLM
  • c1ec294 fix: Support RedisCluster for task command pub/sub messaging

📊 Changes

5 files changed (+32 additions, -15 deletions)

View changed files

📝 backend/open_webui/config.py (+6 -6)
📝 backend/open_webui/tasks.py (+19 -1)
📝 backend/open_webui/utils/middleware.py (+4 -6)
📝 backend/open_webui/utils/tools.py (+1 -1)
📝 src/lib/utils/index.ts (+2 -1)

📄 Description

Summary

Fixes #19840

When using Redis Cluster, stopping a task via POST /api/tasks/stop/{task_id}
results in AttributeError: 'RedisCluster' object has no attribute 'publish'

Root Cause

The redis_send_command() function directly calls redis.publish(), but:

  • Standard Redis has a publish() method
  • RedisCluster does NOT have a publish() method that broadcasts to all nodes
  • In Redis Cluster architecture, PUBLISH commands are node-local

Changes

  • Modified backend/open_webui/tasks.py
  • Added RedisCluster class import from redis.cluster
  • Updated redis_send_command() to handle both:
    • RedisCluster: Iterates through all master nodes and publishes to each
    • Standard Redis: Uses publish() normally

Test

The fix ensures task stop commands reach all worker nodes:

  • For RedisCluster: publishes to every master node (cluster-wide broadcast)
  • For standard Redis: publishes normally (single node)

Checklist

  • Minimal fix focused on the issue
  • No new dependencies added (using existing redis package)
  • Backward compatible (standard Redis still works)
  • Handles cluster architecture correctly (broadcast to all masters)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/20746 **Author:** [@YuriNachos](https://github.com/YuriNachos) **Created:** 1/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-rediscluster-publish` --- ### 📝 Commits (6) - [`f84aad5`](https://github.com/open-webui/open-webui/commit/f84aad5f141ab769d4b75628f576c89c9ff88db9) fix: handle None value for model capabilities in builtin_tools check - [`0d4898f`](https://github.com/open-webui/open-webui/commit/0d4898fa40798e396c4deb2f9cc71b0b7d54baf4) fix: handle None value for model capabilities in file_context check - [`9772be0`](https://github.com/open-webui/open-webui/commit/9772be02cc1d4b4153a76fd15a12d07d47f8eb66) fix: handle None value for capabilities in get_model_capability helper - [`3d404ff`](https://github.com/open-webui/open-webui/commit/3d404ff87cac3d257c56ed1ef198ed5b8c142ecf) fix: URL-encode OAuth client secrets to handle special characters - [`3079444`](https://github.com/open-webui/open-webui/commit/3079444ab2f03123a9a7a4e0dc0e7fe135ea7452) fix: Decode HTML entities in tool call results before sending to LLM - [`c1ec294`](https://github.com/open-webui/open-webui/commit/c1ec294a0392513b7b9d227dc8952236596739ec) fix: Support RedisCluster for task command pub/sub messaging ### 📊 Changes **5 files changed** (+32 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+6 -6) 📝 `backend/open_webui/tasks.py` (+19 -1) 📝 `backend/open_webui/utils/middleware.py` (+4 -6) 📝 `backend/open_webui/utils/tools.py` (+1 -1) 📝 `src/lib/utils/index.ts` (+2 -1) </details> ### 📄 Description ## Summary Fixes #19840 When using Redis Cluster, stopping a task via POST /api/tasks/stop/{task_id} results in AttributeError: 'RedisCluster' object has no attribute 'publish' ## Root Cause The `redis_send_command()` function directly calls `redis.publish()`, but: - Standard Redis has a `publish()` method - RedisCluster does NOT have a `publish()` method that broadcasts to all nodes - In Redis Cluster architecture, PUBLISH commands are node-local ## Changes - Modified `backend/open_webui/tasks.py` - Added `RedisCluster` class import from `redis.cluster` - Updated `redis_send_command()` to handle both: - **RedisCluster**: Iterates through all master nodes and publishes to each - **Standard Redis**: Uses `publish()` normally ## Test The fix ensures task stop commands reach all worker nodes: - For RedisCluster: publishes to every master node (cluster-wide broadcast) - For standard Redis: publishes normally (single node) ## Checklist - [x] Minimal fix focused on the issue - [x] No new dependencies added (using existing redis package) - [x] Backward compatible (standard Redis still works) - [x] Handles cluster architecture correctly (broadcast to all masters) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 06:06:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#25759