Below is a PR with changes to the attachment draft finalization logic. After the update, strange side effects started to appear: on unsuccessful finalization, extra artifacts remain, and parallel operations sometimes begin waiting longer than usual.
after version.DraftService with shared state and a temporary directory.finalize_draft for a draft that:
Mutex<State>.before and after by created files, counter updates, and the duration of holding the shared lock.1.85.0, edition 2021cargo teststd::fs and std::sync::MutexStorage::store_manifest may return an error after successful local file preparationUse line comments to explain the problem, its impact, the fix and how to test it.