Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

fix: add flush check in BulkWriter.sendBatchLocked() callback#631

Merged
thebrianchen merged 2 commits into
masterfrom
bc/bulk-flush
May 14, 2021
Merged

fix: add flush check in BulkWriter.sendBatchLocked() callback#631
thebrianchen merged 2 commits into
masterfrom
bc/bulk-flush

Conversation

@thebrianchen

@thebrianchen thebrianchen commented May 14, 2021

Copy link
Copy Markdown

Found this bug while adding recursive delete tests. I tried to think of a way to add a unit test to check for this, but I couldn't think of an easy test since scheduleCurrentBatchLocked() automatically returns if there are no mutations.

However, not having this check was causing the startAfter() recursive delete test to flake, so that's some indirect coverage 😨

@thebrianchen thebrianchen self-assigned this May 14, 2021
@thebrianchen thebrianchen requested review from a team May 14, 2021 15:46
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label May 14, 2021
@product-auto-label product-auto-label Bot added the api: firestore Issues related to the googleapis/java-firestore API. label May 14, 2021
public void run() {
synchronized (lock) {
scheduleCurrentBatchLocked(flush);
if (flush) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if-check can happen outside the synchronized block.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@thebrianchen thebrianchen merged commit ac3db81 into master May 14, 2021
@thebrianchen thebrianchen deleted the bc/bulk-flush branch May 14, 2021 16:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: firestore Issues related to the googleapis/java-firestore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants