simplify BlockingProcessStreamReader; fix tests#1457
Merged
garrettjonesgoogle merged 1 commit intogoogleapis:masterfrom Dec 8, 2016
pongad:stream-reader
Merged
simplify BlockingProcessStreamReader; fix tests#1457garrettjonesgoogle merged 1 commit intogoogleapis:masterfrom pongad:stream-reader
garrettjonesgoogle merged 1 commit intogoogleapis:masterfrom
pongad:stream-reader
Conversation
Update #1429. This commit simplifies the main run() method. Previous implementation checks whether the underlying Reader is ready to read then either reads a line or sleeps, catching InterruptedException to watch for any thread interruption. There are subtle difficulties with this approach: - Even if the underlying Reader is ready to read, it might not have enough bytes to form a line. It might still block. - It's not necessary to sleep. If the thread is interrupted while reading. It should throw InterruptedIOException. The method now reads in a loop, waiting for either exceptions or EOF. The test class implements a mock Logger that logs to a data structure. It then verifies that the data structure holds appropriate logs. As implemented, this can cause a race, as two threads, the writer and the verifier, run concurrently. This commit fixes this by waiting for the writing thread to terminate before verifying.
github-actions bot
pushed a commit
that referenced
this pull request
Sep 15, 2022
🤖 I have created a release *beep* *boop* --- ## [2.3.7](googleapis/java-bigquerydatatransfer@v2.3.6...v2.3.7) (2022-08-29) ### Dependencies * update dependency com.google.cloud:google-cloud-bigquery to v2.15.0 ([#1456](googleapis/java-bigquerydatatransfer#1456)) ([a20b6e6](googleapis/java-bigquerydatatransfer@a20b6e6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
meltsufin
pushed a commit
that referenced
this pull request
Dec 22, 2025
…ncy-plugin to v3.6.1 (#1457)
chingor13
pushed a commit
that referenced
this pull request
Jan 6, 2026
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
chingor13
pushed a commit
that referenced
this pull request
Jan 22, 2026
…etParent (#1457) * fix: set database ID on parent key * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
chingor13
pushed a commit
that referenced
this pull request
Jan 22, 2026
🤖 I have created a release *beep* *boop* --- ## [2.20.0](https://togithub.com/googleapis/java-datastore/compare/v2.19.3...v2.20.0) (2024-05-27) ### Features * New PropertyMask field which allows partial commits, lookups, and query results ([#1455](https://togithub.com/googleapis/java-datastore/issues/1455)) ([ff5e397](https://togithub.com/googleapis/java-datastore/commit/ff5e39775446216b4806f55f14dacb7fc8e8854b)) ### Bug Fixes * Migrate off TextPrinter's deprecated methods ([#1452](https://togithub.com/googleapis/java-datastore/issues/1452)) ([c3c1317](https://togithub.com/googleapis/java-datastore/commit/c3c131735863d71971110e2ac7ac0244ce16ee92)) * Set the correct database id on the key parent when calling Key#getParent ([#1457](https://togithub.com/googleapis/java-datastore/issues/1457)) ([992815d](https://togithub.com/googleapis/java-datastore/commit/992815d9989d04f7b371dfa320ed17894626a07f)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.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.
Update #1429.
This commit simplifies the main run() method.
Previous implementation checks whether the underlying Reader is ready to read
then either reads a line or sleeps,
catching InterruptedException to watch for any thread interruption.
There are subtle difficulties with this approach:
enough bytes to form a line. It might still block.
reading. It should throw InterruptedIOException.
The method now reads in a loop, waiting for either exceptions or EOF.
The test class implements a mock Logger that logs to a data structure.
It then verifies that the data structure holds appropriate logs.
As implemented, this can cause a race, as two threads,
the writer and the verifier, run concurrently.
This commit fixes this by waiting for the writing thread to terminate
before verifying.