-
Notifications
You must be signed in to change notification settings - Fork 421
Feature request: On batch processing, fill in processor result even if BatchProcessingError is raised #3716
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Thanks for raising this @nico00. I guess it depends on what you're trying to do with them – Lambda will auto redrive to reprocess these messages at a service level. |
That's correct but in such case Lambda is limited to two retries, while DynamoDb stream allows up to 10,000 retries. On the other side I see no cons in filling in processor result just before raising BatchProcessingError. |
hey @nico00, please allow me to ask some clarifying questions
It's technically a Lambda invocation failure, as recommended by the Lambda team. The Lambda Poller picks up the error and considers the entire batch a failure, there is no empty response in this case. Are you experiencing an empty response instead of a
Would you be able to expand with one or more examples to help us picture this better? I'm trying to understand whether you want to intercept a Thanks a lot! |
Also, before I forget, thank you for creating a feature request :) We always appreciate hearing from customers and learning what additional use cases can be unblocked (or made easier!) for everyone |
This feature request was added in the v2.41.0 release. Closing as completed. |
|
Use case
According to the documentation (https://docs.powertools.aws.dev/lambda/python/latest/utilities/batch/#partial-failure-mechanics), BatchProcessingError is raised when all records failed to be processed. In such case, processor response appears empty, as all records have been successfully processed. Having the processor response filled with the list of failed records, would help in reprocessing them.
Solution/User Experience
I suggest that the processor response be compiled before raising BatchProcessingError (class BasePartialBatchProcessor).
This would give the programmer the freedom to decide what to do according to various business cases.
Current approach:
Proposed solution:
Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: