fix(receiver): ack messages that cannot be parsed or resolved - #652
Open
Sanjays2402 wants to merge 1 commit into
Open
fix(receiver): ack messages that cannot be parsed or resolved#652Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
When a message fails formatter parsing or names a task the broker cannot find, the receiver logged a warning and returned without acknowledging. For ackable brokers (e.g. RabbitMQ) the message stayed unacked and pending forever: it was already prefetched out of the queue, so purging the queue did not clear it and it only reappeared when the consumer was terminated. Both early-return paths now ack the message when it is ackable, since a message that cannot be parsed or whose task does not exist will never become processable by a redelivery. Adds regression tests for both paths. Closes taskiq-python#569
s3rius
approved these changes
Jul 28, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #652 +/- ##
==========================================
+ Coverage 81.29% 81.32% +0.02%
==========================================
Files 69 69
Lines 2577 2581 +4
==========================================
+ Hits 2095 2099 +4
Misses 482 482 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #569
When
Receiver.callbackcannot parse a message, or the named task is not registered, it logged a warning and returned without acking. For ackable brokers the message was already prefetched out of the queue, so it stayed pending forever - purging the queue did not clear it, and it only reappeared when the consumer was terminated.Both early-return paths now ack the message when it is ackable: neither an unparsable payload nor a missing task becomes processable on redelivery.
Regression tests added for both paths; they fail on master (message never acked) and pass with the fix.