mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #21021] [MERGED] feat: Add REDIS_RECONNECT_DELAY environment variable as positive float for handle retry delay on timeout/connection errors for redis #41523
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21021
Author: @ctolon
Created: 1/28/2026
Status: ✅ Merged
Merged: 1/29/2026
Merged by: @tjbck
Base:
dev← Head:dev📝 Commits (1)
46fe26aREDIS_RECONNECT_DELAY as positive float for handle retry delay on timeout/connection errors📊 Changes
2 files changed (+25 additions, -0 deletions)
View changed files
📝
backend/open_webui/env.py(+16 -0)📝
backend/open_webui/utils/redis.py(+9 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. Not targeting thedevbranch will lead to immediate closure of the PR.Changelog Entry
Description
The change improves stability during Sentinel failover scenarios by preventing tight retry loops that may otherwise overwhelm Redis or block the event loop.
The reconnect delay is configurable via the existing REDIS_RECONNECT_DELAY environment variable and is fully optional. When unset or invalid, retry behavior remains unchanged.
Without a retry delay, when a Redis Sentinel master service goes down, the client enters a very fast retry loop while Sentinel is still in the process of electing and promoting a new master. During this window, all reconnection attempts are exhausted almost immediately, causing Redis-dependent services to fail even though a new master becomes available shortly after.
Added
Changed
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.