Skip to content

test(spanner): unflake AsyncResultSetImplTest - #14656

Merged
sakthivelmanii merged 1 commit into
mainfrom
unflake-b573570072-asyncresultsetimpltest
Oct 14, 2026
Merged

sakthivelmanii merged 1 commit into
mainfrom
unflake-b573570072-asyncresultsetimpltest

Conversation

@sakthivelmanii

Copy link
Copy Markdown
Contributor

Production busy-spin hang in AsyncResultSetImpl when a ReadyCallback throws an exception, causing ProduceRowsRunnable to loop infinitely when buffer is full. Triggered by test race on paused flag in testCallbackIsNotCalledWhilePaused. Fixed by including cursorReturnedDoneOrException in producer stop condition and adding lock-based test synchronization.

Production busy-spin hang in AsyncResultSetImpl when a ReadyCallback throws an exception, causing ProduceRowsRunnable to loop infinitely when buffer is full. Triggered by test race on paused flag in testCallbackIsNotCalledWhilePaused. Fixed by including cursorReturnedDoneOrException in producer stop condition and adding lock-based test synchronization.
@sakthivelmanii
sakthivelmanii requested review from a team as code owners October 14, 2026 16:00
@sakthivelmanii
sakthivelmanii enabled auto-merge (squash) October 14, 2026 16:00

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request addresses a potential hang in AsyncResultSetImpl where the producer thread could indefinitely wait for a full buffer to be consumed if the callback throws an exception. It introduces a shouldStopProducing() method to ensure the producer stops in such scenarios, adds synchronization to pause/resume logic in tests, and adds a new test case for this failure mode. The review feedback suggests using Mockito's timeout verification in the new test to prevent flakiness from asynchronous close operations.

@sakthivelmanii
sakthivelmanii merged commit 50da24e into main Oct 14, 2026
204 checks passed
@sakthivelmanii
sakthivelmanii deleted the unflake-b573570072-asyncresultsetimpltest branch October 14, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants