Skip to content

fix(config): unique temp files for concurrent config saves - #151

Merged
mrnasil merged 1 commit into
mainfrom
fix/atomic-config-save
Oct 9, 2026
Merged

mrnasil merged 1 commit into
mainfrom
fix/atomic-config-save

Conversation

@mrnasil

@mrnasil mrnasil commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

  • write_atomic used one temp path per process (.{name}.tmp-{pid}-{seq}), so two threads saving the same config.toml raced on std::fs::write and returned File exists (os error 17).
  • Temp names now include the thread id, and a failed rename is retried once.
  • This is the failure blocking Dependabot PR chore(deps): bump the rust-minor group across 1 directory with 5 updates #150 (provider_list_api_base_model_cap_and_empty_agents).

Test plan

  • cargo test -p whycodes-config --lib write_atomic
  • panic / swallowed-error / dependency / secrets budgets
  • cargo fmt --all --check
  • cargo clippy -p whycodes-config --all-targets -- -D warnings

write_atomic reused one path per process and sequence number, so two threads saving the same config.toml raced on std::fs::write and returned File exists. Include the thread id and retry the rename once.
@mrnasil
mrnasil merged commit 48fca59 into main Oct 9, 2026
13 of 14 checks passed
@mrnasil
mrnasil deleted the fix/atomic-config-save branch October 9, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant