mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #22372] [CLOSED] fix: refresh CONFIG_DATA from DB before saving to prevent stale overwrites in multi-worker environments #49688
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/22372
Author: @Classic298
Created: 3/7/2026
Status: ❌ Closed
Base:
dev← Head:fix/persistent-config-stale-overwrite📝 Commits (1)
ac1314efix: refresh CONFIG_DATA from DB before saving to prevent stale overwrites in multi-worker environments📊 Changes
1 file changed (+5 additions, -0 deletions)
View changed files
📝
backend/open_webui/config.py(+5 -0)📄 Description
In multi-worker setups (multiple uvicorn workers or Kubernetes replicas), each worker maintains its own in-memory copy of CONFIG_DATA loaded at startup. When any worker saves a config change, PersistentConfig.save() writes the entire CONFIG_DATA blob to the database -- silently overwriting changes made by other workers (e.g. OpenAI connection model IDs).
This adds a get_config() call at the top of save() to re-read the latest state from the database before merging in the new value, ensuring cross-worker changes are preserved.
Fixes #22322
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.