🟡 [M8] 配置写入非原子,并发读取可能回退默认 #18

Closed
opened 2026-06-03 13:53:57 +08:00 by dailz · 0 comments
Owner

文件: core/config.rs:67-94
分类: 并发 / 配置

问题: std::fs::write 非原子,并发 read_to_string 可能读到部分 TOML → 解析失败 → 静默回退默认值。

建议修复: 写入临时文件 → sync_all → atomic rename;区分文件不存在和解析错误。

**文件**: `core/config.rs:67-94` **分类**: 并发 / 配置 **问题**: `std::fs::write` 非原子,并发 `read_to_string` 可能读到部分 TOML → 解析失败 → 静默回退默认值。 **建议修复**: 写入临时文件 → `sync_all` → atomic rename;区分文件不存在和解析错误。
dailz added the area/concurrencyseverity/mediumbug labels 2026-06-03 13:53:57 +08:00
dailz closed this issue 2026-06-09 17:30:53 +08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dailz/logViewer#18