mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #22582] [CLOSED] fix: session cleanup lock #26766
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/22582
Author: @Ithanil
Created: 3/11/2026
Status: ❌ Closed
Base:
dev← Head:fix_session_cleanup📝 Commits (2)
cd77a33Fix session cleanup lock renewal cadence64fa17ereduce default WEBSOCKET_REDIS_LOCK_TIMEOUT to 15 seconds📊 Changes
2 files changed (+15 additions, -3 deletions)
View changed files
📝
backend/open_webui/env.py(+2 -2)📝
backend/open_webui/socket/main.py(+13 -1)📄 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. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
SESSION_POOL_TIMEOUT(120s) wait period. This prevents the session cleanup worker from dropping its lock and exiting early whenWEBSOCKET_REDIS_LOCK_TIMEOUTis shorter than the session reap interval (which it was by default)WEBSOCKET_REDIS_LOCK_TIMEOUTto a much shorter value (I opted for 15s), reducing the long startup time of replicas since https://github.com/open-webui/open-webui/pull/15328Changed
backend/open_webui/socket/main.pyto split theSESSION_POOL_TIMEOUTsleep into smaller intervals based onWEBSOCKET_REDIS_LOCK_TIMEOUT / 2.WEBSOCKET_REDIS_LOCK_TIMEOUTto 15 seconds.Fixed
"open-webui:session_cleanup_lock"and then the log linesopen_webui.socket.main:periodic_session_pool_cleanup:188 - Unable to renew session cleanup lock. Exiting.on the next cleanup iteration.WEBSOCKET_REDIS_LOCK_TIMEOUTvalues compatible with theSESSION_POOL_TIMEOUT-based cleanup loop.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.