mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[PR #23571] [MERGED] fix: enable TCP socket keepalive on all client connections for better Redis reliability #66112
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/23571
Author: @Classic298
Created: 4/10/2026
Status: ✅ Merged
Merged: 4/11/2026
Merged by: @tjbck
Base:
dev← Head:claude/redis-socket-keepalive📝 Commits (1)
cd087b5fix(redis): add opt-in TCP socket keepalive on all client connections📊 Changes
2 files changed (+20 additions, -0 deletions)
View changed files
📝
backend/open_webui/env.py(+9 -0)📝
backend/open_webui/utils/redis.py(+11 -0)📄 Description
Turns on socket_keepalive=True for every Redis client created by get_redis_connection (plain, cluster and sentinel paths, sync and async). Lets the kernel detect dead peers on idle connections and avoids "Connection reset by peer" errors from the next request picking a half-closed socket out of the pool.
This improves redis reliability.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.