GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — test(spanner): unflake InlineBeginTransactionTest by sakthivelmanii · Pull Request #14783 · googleapis/google-cloud-java Conversation
Contributor
SummaryIn GrpcResultSet.close(), a previous commit inadvertently moved iterator.close() ahead of listener.onDone(). Cancelling the stream unblocked concurrent reader threads in next() with CANCELLED, triggering yieldError() which completed transactionIdFuture with ABORTED before listener.onDone() could complete it with FAILED_PRECONDITION. This race caused flaky test failures in InlineBeginTransactionTest. This PR fixes the issue by reordering listener.onDone(withBeginTransaction) before iterator.close(), guaranteeing the future is marked FAILED_PRECONDITION before the stream is cancelled. It also includes a deterministic regression test to ensure the fix is robust.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
In GrpcResultSet.close(), a previous commit inadvertently moved iterator.close() ahead of listener.onDone(). Cancelling the stream unblocked concurrent reader threads in next() with CANCELLED, triggering yieldError() which completed transactionIdFuture with ABORTED before listener.onDone() could complete it with FAILED_PRECONDITION. This race caused flaky test failures in InlineBeginTransactionTest. This PR fixes the issue by reordering listener.onDone(withBeginTransaction) before iterator.close(), guaranteeing the future is marked FAILED_PRECONDITION before the stream is cancelled. It also includes a deterministic regression test to ensure the fix is robust.
sakthivelmanii
enabled auto-merge (squash)
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code ReviewThis pull request updates GrpcResultSet.close() to notify the listener before closing the iterator, preventing a race condition where a concurrent reader thread fails with a CANCELLED error before the listener is notified. A new unit test has been added to verify this behavior. The review feedback suggests wrapping the listener notification and iterator closing in a try-finally block to ensure the iterator is always closed, even if the listener throws an unexpected exception.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code ReviewThis pull request updates
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code ReviewThis pull request modifies GrpcResultSet.close() to notify the listener before cancelling the stream, preventing race conditions with concurrent readers, and adds a corresponding unit test. However, the change accidentally omitted the call to iterator.close(), leaving an empty finally block. This critical issue will cause resource leaks, and the iterator must be closed within the finally block as suggested.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code ReviewThis pull request modifies GrpcResultSet.close() to notify the listener before closing the iterator, preventing a race condition where a concurrent thread blocked in next() fails with a CANCELLED error before the listener is notified. A unit test was added to verify this behavior. The review feedback suggests improving the unit test by checking if the reader thread's future is done inside the waiting loop to fail fast if the thread terminates unexpectedly.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code ReviewThis pull request modifies
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
auto-merge was automatically disabled
Pull request was closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers1 more reviewerUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |