firestore: let BulkWriter retry only when a retriable error occurs #9295
Labels
api: firestore
Issues related to the Firestore API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
BulkWriter will retry 10 times if it encounters an error that cannot be resolved by retrying. This slows down the process unnecessarily. If the error is not resolved by retrying, it is better to return an error immediately without retrying.
Here is an example.
Suppose you already have a Document on Firestore and call
BulkWriter.Create
on it. In that case, an AlreadyExists error occurs andBulkWriter
retries 10 times to write in vain. In my environment, it took 10 seconds for all the retry to finish.Describe the solution you'd like
BulkWriter doesn't retry write operations when errors occur that cannot be resolved by retrying.
As with Transaction, why not retry only when the error code is ABORTED?
Describe alternatives you've considered
When creating a BulkWriter, it would be good if the module user could specify the errors to retry as an option.
Additional context
BulkWriter's retry process is here.
I use BulkWriter's Create and Update as asynchronous processes. This asynchronous processing may be called multiple times and the order of processing is not guaranteed. That's why things like the first example I gave happen.
The text was updated successfully, but these errors were encountered: