-
Notifications
You must be signed in to change notification settings - Fork 66
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
firestore.BulkWriter.flush() has a race #1772
Comments
@tom-andersen - Nice fix! Way cooler than mine. :) |
@tom-andersen & @milaGGL - I've been testing with the fix for a few days, and I still see a few problems. The one I've been running down is difficult for me to understand, but here's what I've got so far: We create somewhere between 15,000 and 30,000 write operations. Occasionally, something will happen that will prevent some of the earlier operations from making their way into a In one case I have logs to, I see the 819th - 837th operation not get into a batch until the final operation - in this case, the 14,530th operation. When those operations finally run and finish, they are the last. And now every operation has been executed successfully. The futures chain starts propagating success up towards This does not happen every time. And I have varying streaks of lucky and unlucky. |
Is this happening with both fixes? |
I only saw "fix: BulkWriter flush logic #1778"... is there another? Or you mean my attempt? I saw things getting stuck with mine, too. |
bulkWriter.flush()
(and thereforebulkWriter.close()
have a race when checking to see if there are more items to flush.We noticed this in our Cloud Function application that tries to write 30,000 records to a collection.
I have a fix that is working here:
https://github.com/thewildllama/java-firestore/tree/bulk-writer-flush-fix
I detailed the problem in my commit message:
Environment details
OS type and version: Linux/macOS
Java version: 21
Version(s): com.google.cloud:google-cloud-firestore:3.22.0, com.google.cloud:google-cloud-firestore:3.24.2
Steps to reproduce
Code example
The text was updated successfully, but these errors were encountered: