Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I removed every delete from my exactly‑once guard. Then the bugs moved.

说明与用途

删除文件系统中的删除操作,改用生成号式声明并进行双重年龄检查,消除了重复计费并确保在高并发下正确处理退款。

问题

Exactly‑once processing guard failed under concurrency and stale claim scenarios, causing duplicate charges and missed refunds.

结果

Removed delete operations, switched to generation‑based claims, and added dual age checks, resulting in zero duplicate charges and reliable refunds under high concurrency.

工作流

  • 1. Workers attempt to create a claim file with os.open(..., O_CREAT|O_EXCL).
  • 2. If claim exists, worker reads claim metadata and checks age using min(record_age, mtime_age).
  • 3. If claim is stale, worker creates a new generation claim file without deleting the old one.
  • 4. Workers process the charge only if they own the latest generation claim.
  • 5. Refunds are processed after successful charge and logged; no duplicate refunds occur.
  • 6. Tests validate concurrency, TTL handling, and clock drift scenarios.

证据

fixed generation: 0/20 double executions 16 workers x 40 trials: 0 double executions

来源

claim age. A claim records when it was made. That record is written by the claim, so it can be wrong

来源

  • 记录日期: 2026-09-08T19:00:27.375Z