Commit c3d3cdc
fix(task-management): delete expired dedup lock before insert to avoid phantom 409
The unique constraint on idempotency_keys(key, org, endpoint) has no
expires_at clause, so an expired-but-not-yet-cleaned-up row blocks a fresh
INSERT with the same deterministic key. Added a targeted DELETE ... WHERE
expires_at < NOW() immediately before the dedup lock INSERT so stale rows
never cause a spurious IN_FLIGHT 409.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 9d7cdbd commit c3d3cdc
1 file changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
| 719 | + | |
719 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
720 | 733 | | |
721 | 734 | | |
722 | 735 | | |
723 | 736 | | |
724 | 737 | | |
725 | | - | |
| 738 | + | |
726 | 739 | | |
727 | 740 | | |
728 | 741 | | |
| |||
0 commit comments