fix(crawler): guard ack_done/ack_failed/release on state='running' (0.35.3)
The three lease-ack functions matched their UPDATE on the job id alone. If a lease expired and another worker re-leased the row, a late ack from the original worker would clobber the new lease's state, leased_until, and (for release) decrement its attempts. Add `AND state = 'running'` to each UPDATE and log a warn when rows_affected is zero, so a stolen lease shows up in telemetry without blocking the new lease holder's progress. Three new integration tests pin the contract: - ack_done_no_ops_when_lease_was_stolen - ack_failed_no_ops_when_state_is_not_running - release_no_ops_when_state_is_not_running Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2
backend/Cargo.lock
generated
2
backend/Cargo.lock
generated
@@ -1470,7 +1470,7 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
|
||||
|
||||
[[package]]
|
||||
name = "mangalord"
|
||||
version = "0.35.1"
|
||||
version = "0.35.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"argon2",
|
||||
|
||||
Reference in New Issue
Block a user