You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(config): developer, embeddings and auth config_manager writes bypass the config write lock #21858
Found while landing #21742 (agent-config writes now hold the one config write lock).
Problem
services/config_write_lock.py serialises the ConfigService writers, the agent-config writes and config rollback. These direct config_manager read-modify-writes still take no lock, so they can interleave with a rollback or a ConfigService write and lose one of the two writes:
Other direct writers seen in the same grep, to be judged in this issue: autobot-backend/utils/llm_config_sync.py:219-222, autobot-backend/services/web_research_config.py:87-92, autobot-backend/config/model_config.py:83-86.
Acceptance criteria
Each listed read-modify-write holds CONFIG_WRITE_LOCK (via locked_config_write) for its whole operation; no second lock is added.
The config_write_lock.py docstring no longer lists them as uncovered.
A test shows a concurrent write from one of them and a rollback serialise.
Closure evidence, origin/main after #21860 (5002cb4):
AC
Evidence
Each listed read-modify-write holds CONFIG_WRITE_LOCK for its whole operation, with no second lock
The new autobot-backend/services/config_manager_writer.py:16-17,23-24 defines set_nested_and_save and merge_nested_and_save, both @locked_config_write. Callers: api/developer.py:138 (merge_nested_and_save, so the read is now inside the lock), api/embeddings.py:179 and api/auth.py:388 (set_nested_and_save). The extra writers are locked too: utils/llm_config_sync.py:220 (a whole-key overwrite of the model list), services/web_research_config.py:82 and config/model_config.py:80 (@locked_config_write on save_settings / update_llm_model). No new lock object; all of them share the RLock in services/config_write_lock.py.
The config_write_lock.py docstring no longer lists them as uncovered
Lines 11-17 list them as covered. They state that every config_manager.save_settings() caller is locked and name the sweep result, and they say the sweep covers save_settings only.
A test shows a concurrent write from one of them and a rollback serialise
api/config_manager_write_lock_21858_test.py::test_developer_merge_and_rollback_do_not_lose_either_write (L16) parks one writer inside the lock and asserts that rollback_locked does not enter until it is released, then checks the final state. ::test_two_direct_writers_do_not_interleave (L33). Shared doubles: tests/_config_write_lock_doubles.py.
Activity
fix(config): share the lock-test helpers and state the save_settings …
test(config): the shared lock-test doubles live under tests/ like the…
Merge pull request #21860 from mrveiss/issue-21858-config-lock-review…
github-actions commentedon Nov 19, 2026
Landed in #21860, merge
518fda9dafmrveiss commentedon Nov 19, 2026
Closure evidence, origin/main after #21860 (5002cb4):
CONFIG_WRITE_LOCKfor its whole operation, with no second lockautobot-backend/services/config_manager_writer.py:16-17,23-24definesset_nested_and_saveandmerge_nested_and_save, both@locked_config_write. Callers:api/developer.py:138(merge_nested_and_save, so the read is now inside the lock),api/embeddings.py:179andapi/auth.py:388(set_nested_and_save). The extra writers are locked too:utils/llm_config_sync.py:220(a whole-key overwrite of the model list),services/web_research_config.py:82andconfig/model_config.py:80(@locked_config_writeonsave_settings/update_llm_model). No new lock object; all of them share the RLock inservices/config_write_lock.py.config_write_lock.pydocstring no longer lists them as uncoveredconfig_manager.save_settings()caller is locked and name the sweep result, and they say the sweep coverssave_settingsonly.api/config_manager_write_lock_21858_test.py::test_developer_merge_and_rollback_do_not_lose_either_write(L16) parks one writer inside the lock and asserts thatrollback_lockeddoes not enter until it is released, then checks the final state.::test_two_direct_writers_do_not_interleave(L33). Shared doubles:tests/_config_write_lock_doubles.py.fix(config): hold the config write lock across developer, embeddings,…