fix: add flush check in BulkWriter.sendBatchLocked() callback#631
Merged
thebrianchen merged 2 commits intomasterfrom May 14, 2021
Merged
fix: add flush check in BulkWriter.sendBatchLocked() callback#631thebrianchen merged 2 commits intomasterfrom
thebrianchen merged 2 commits intomasterfrom
Conversation
| public void run() { | ||
| synchronized (lock) { | ||
| scheduleCurrentBatchLocked(flush); | ||
| if (flush) { |
Contributor
There was a problem hiding this comment.
The if-check can happen outside the synchronized block.
schmidt-sebastian
approved these changes
May 14, 2021
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
May 17, 2021
🤖 I have created a release \*beep\* \*boop\* --- ## [2.4.0](https://www.github.com/googleapis/java-firestore/compare/v2.3.0...v2.4.0) (2021-05-17) ### Features * add buffering layer to BulkWriter ([#611](https://www.github.com/googleapis/java-firestore/issues/611)) ([a7caff2](https://www.github.com/googleapis/java-firestore/commit/a7caff2c15ad8ad4e98165bf4029d9615c079637)) ### Bug Fixes * add flush check in BulkWriter.sendBatchLocked() callback ([#631](https://www.github.com/googleapis/java-firestore/issues/631)) ([ac3db81](https://www.github.com/googleapis/java-firestore/commit/ac3db81741ac74614d9eeae70a3f2eae6dcc9548)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#626](https://www.github.com/googleapis/java-firestore/issues/626)) ([00dbe33](https://www.github.com/googleapis/java-firestore/commit/00dbe33b426ea1509f9fb72181a36dd1a83b15cc)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 😨