原子 CAS 操作在 IsAvailable/RecordFailure/RecordSuccess 之间存在协调问题, 改用 sync.Mutex 保护 failCount 和 failedUntil 的联合更新,简化逻辑并保证一致性。 同时预分配 backups 切片容量避免多次内存分配。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
原子 CAS 操作在 IsAvailable/RecordFailure/RecordSuccess 之间存在协调问题, 改用 sync.Mutex 保护 failCount 和 failedUntil 的联合更新,简化逻辑并保证一致性。 同时预分配 backups 切片容量避免多次内存分配。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>