You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there is a message for which the mapper function has started processing, and the service using ziggurat is shut down, the mapper function execution for the message stops without running the complete function.
When the service is started again, the message is not reprocessed by the service, leading to loss of the message. This issue was seen on ziggurat v2.12.4
Steps to reproduce
Consume a message with a long execution time mapper-fn.
Add a log at the start of the mapper fn and at the end of the mapper fn.
Restart the service immediately.
Message which did not fully process due to shutdown, will not be reprocessed by ziggurat.
The text was updated successfully, but these errors were encountered:
We're picking this bug up.
From our analysis, the root cause is ziggurat.messaging.consumer/convert-and-ack-message. It acks the message before passing it to the wrapped-mapper-fn i.e. ziggurat.mapper/mapper-func.
This works fine in most of the cases as ziggurat.mapper/mapper-func does its own error handling and pushes the message to retry queue on exception. But it fails when the service stops before the processing is complete.
Solution:
We analysed 2 approaches for fixing this.
Acking the message after wrapped-mapper-func completes processing. This is the most straightforward approach.
We reject the message if the processing of the message is incomplete. This approach won't work in this particular scenario as if the process stops while mapper-func is running, reject will never be called.
When there is a message for which the mapper function has started processing, and the service using ziggurat is shut down, the mapper function execution for the message stops without running the complete function.
When the service is started again, the message is not reprocessed by the service, leading to loss of the message. This issue was seen on ziggurat v2.12.4
Steps to reproduce
Add a log at the start of the mapper fn and at the end of the mapper fn.
The text was updated successfully, but these errors were encountered: