-
Notifications
You must be signed in to change notification settings - Fork 150
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
Feature request: ability to not throw error on full batch failure #2122
Comments
As discussed with @dreamorosi , I want to support the introduction of a
Here's an example: this Lambda function is allowed to scale up to 100 concurrent executions, but it does not because it sees many FullBatchFailureErrors, which make it scale down. The official AWS docs are a little ambiguous and suggest that this behavior is not active when partial failure reporting is configured. In fact, it is active and behaves the same, i.e. Lambda concurrency is reduced when errors are thrown. This was confirmed by an AWS engineer. If throwing FullBatchFailureError is disabled, e.g. by overwriting the right method: Then the function will use its full concurrency. You can debate if scaling up is actually useful when there are so many failed batches, but that is besides the point. It is a non-obvious behavior that is not present if you implement partial failure reporting without throwing a specific error, and the AWS docs do not suggest to implement such an error. In addition to implementing the
|
I believe adding the option inside Just to confirm, if By the way, you can assign this to me. |
Hi @arnabrahman, yes the default behavior or when the option is not provided, should be the same as now. I agree with where to put the new option as well, let's do it! Thank you! |
This issue is now closed. Please be mindful that future comments are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so. |
Use case
Note
This feature request comes from #1785
Currently when using the Batch Processor utility, if all the records in a batch are marked as failed the utility throws a
BatchProcessingError
.Taking into consideration that the utility is supposed to be used with partial failure reporting, a Lambda function that throws an error is functionally equal to a partial failure that reports all items as failed in the sense that all the items in that batch are retried as a result.
While we initially implemented this as an error to reflect the full batch failure in the operational metrics (i.e. function runtime errors), there are cases such as when processing small batches that this behavior can skew the metrics due to higher chances of a full batch to fail.
To accommodate these use cases, as well as those customers who simply want to avoid throwing an error, we should add a new
throwOnFullBatchFailure
option to the utility that allows customers to opt out of the error throwing mechanism.Solution/User Experience
I haven't spent a lot of time thinking on where the new option should land, but the two options that come to mind are either when initializing the processor:
or in the process function itself:
Without looking at the internal implementation - which will inevitably inform the decision - I'm more inclined towards the second option for additional granularity (i.e. I might want to reuse the same
BatchProcessor
across multiple routes) and also because we already have a configuration object parameter that we can extend.Alternative solutions
No response
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: