fix: bound the lock leak when broker.kick() fails (#83)

This commit is contained in:
d3vyce
2026-07-29 10:27:25 +02:00
committed by GitHub
parent e75b9f3f20
commit d8835733ed
4 changed files with 100 additions and 4 deletions
+6
View File
@@ -88,6 +88,12 @@ fingerprint. Any subsequent dispatch with the same fingerprint raises
`DuplicateTaskError` while the lock is held. The lock is released automatically when
the task completes or fails.
The lock is acquired in two phases. It is first taken with a short grace TTL of 10
seconds, then extended to its full TTL once the broker has accepted the message.
taskiq fires no middleware hook when the send itself fails, so this bounds the
damage: if the broker is unreachable, the lock of a task that was never queued
expires within seconds instead of blocking its fingerprint for the full TTL.
## Handling duplicates
When a duplicate is detected, the middleware logs a warning and raises