Bug: Race condition in timestamp-based queue lock fallback #115
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Audit Finding
Severity: Medium
Issue:
acquireTimestampLock()reads lock time, checks staleness, then writes — classic TOCTOU race. Two concurrent processes could both acquire the lock. MySQL/PostgreSQL advisory lock paths are correct but the fallback is unreliable.Fix: Use atomic UPDATE with WHERE clause checking old value, then verify
getAffectedRows()> 0.Files:
QueueProcessor.phpBranch created:
feature/115-bug-race-condition-in-timestamp-based-qu