Skip to content

Conversation

@thebrianchen
Copy link

@thebrianchen thebrianchen commented May 14, 2021

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 a review from a team as a code owner May 14, 2021 15:46
@thebrianchen thebrianchen requested a 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
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
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 join this conversation on GitHub. Already have an account? Sign in to comment

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