New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log decode errors, do not ack. #281
Conversation
@@ -135,6 +135,10 @@ def on_nova(self, body, message): | |||
(e, json.loads(str(message.body)))) | |||
raise | |||
|
|||
def on_decode_error(self, message, exc): | |||
_get_child_logger().exception("Decode Error: %s" % exc) | |||
# no NOT call message.ack(), otherwise the message will be lost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/no Not/Do Not/
perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
Where is this actually called? |
in kombu serialization. |
or if you mean where on_decode_error is called, it is also a hook from the kombu mixin: https://kombu.readthedocs.org/en/latest/reference/kombu.mixins.html#kombu-mixins |
rebased to current master |
rebased again |
Are we still pursuing the feature this PR is related to?? |
Yes, but the other PR is only slightly related. |
Going back through all that transpired, yeah, I agree. Hehe, that auto ack from the mixin base class in the on_decode_error is kind of scary. |
Can you rebase this from master, bkw? |
rebased again. |
Thanks! |
In case of decoding errors (most likely caused be an installed json library that cannot deal with kombu's message buffers) log the error and do NOT ack the message. Otherwise we lose messages.
This is a precursor for another pr coming up, that fixes the decoding errors.