[PR #22372] [CLOSED] fix: refresh CONFIG_DATA from DB before saving to prevent stale overwrites in multi-worker environments #49688

Closed
opened 2026-04-30 01:59:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22372
Author: @Classic298
Created: 3/7/2026
Status: Closed

Base: devHead: fix/persistent-config-stale-overwrite


📝 Commits (1)

  • ac1314e fix: 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.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22372 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 3/7/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/persistent-config-stale-overwrite` --- ### 📝 Commits (1) - [`ac1314e`](https://github.com/open-webui/open-webui/commit/ac1314e223c8994a289ab2d9111264c1a90931e9) fix: refresh CONFIG_DATA from DB before saving to prevent stale overwrites in multi-worker environments ### 📊 Changes **1 file changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+5 -0) </details> ### 📄 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 <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. --> By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 01:59:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#49688