mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
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/23044
Author: @snesan821
Created: 3/25/2026
Status: 🔄 Open
Base:
dev← Head:main📝 Commits (1)
c092420fix(backend): clear orphaned Redis task IDs on startup and explicit stop (#22525)📊 Changes
2 files changed (+56 additions, -0 deletions)
View changed files
📝
backend/open_webui/main.py(+4 -0)📝
backend/open_webui/tasks.py(+52 -0)📄 Description
fix(backend): clear orphaned Redis task IDs on startup and explicit stop (#22525)
Description
This PR resolves a critical state-synchronization bug where generation tasks orphaned by a server restart would "brick" the UI in a permanent loading state. By implementing a startup cleanup routine and hardening the manual stop endpoint, we ensure Redis and in-memory state stay consistent even after crashes or rollouts.
Added
clear_all_tasks()function inbackend/open_webui/tasks.pyto handle bulk cleanup of Redis hash keys (REDIS_TASKS_KEY) and set patterns (REDIS_ITEM_TASKS_KEY:*).Changed
lifespanhandler inbackend/open_webui/main.pynow callsclear_all_taskson startup to ensure a clean slate.stop_taskinbackend/open_webui/tasks.pynow explicitly deletes keys from Redis and local dictionaries instead of relying on background worker callbacks which may be dead.Fixed
stop_taskreliability by adding byte-decoding for Redis values and idempotent deletion logic.Pull Request Checklist
devbranch.Changelog Entry
Fixed
Additional Information
/stopendpoint previously only sent an abort signal; if no worker was alive to receive it, the Redis key stayed forever. This fix adds a "Hard Delete" to the stop command and a "Flush on Boot" to the server.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.