Repository navigation
fix(bigquery/storage/managedwriter): address panic on client close - #20932
Merged
Merged
Conversation
Closing the outer client (not the individual writers or streams) exposes a condition where we attempt to mark a pending write more than once, which in this case yields a panic due to double-closure of an associated channel. This PR removes the potential markDone that fires when connection selection fails (related to the transport shutdown), making the finalization of the write a responsibility of the caller. This PR also adds tests to validate the behavior.
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the call to markDone when selectConn fails in appendWithRetry, delegating the finalization of pending writes to the callers. It also adds a new test, TestManagedStream_PoolCloseWithRetriesCompletesInflight, to verify that in-flight appends are properly finalized without panicking when the connection pool is closed. There are no review comments, and I have no feedback to provide.
suzmue
approved these changes
Nov 18, 2026
Merged
shollyman
pushed a commit
that referenced
this pull request
Nov 25, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>auth: 0.24.5</summary> ## [0.24.5](auth/v0.24.4...auth/v0.24.5) (2026-11-25) ### Bug Fixes * **auth/credentials/downscope:** Update universe resolution ([#20967](#20967)) ([16e0475](16e0475)) * **auth:** Add ES256 length validation ([#20949](#20949)) ([35958cc](35958cc)) * **auth:** Improve directpath resolution ([#21004](#21004)) ([ceeb6a1](ceeb6a1)) </details> <details><summary>bigquery: 1.86.4</summary> ## [1.86.4](bigquery/v1.86.3...bigquery/v1.86.4) (2026-11-25) ### Bug Fixes * **bigquery/storage/managedwriter:** Address panic on client close ([#20932](#20932)) ([7a5e14f](7a5e14f)) </details> <details><summary>profiler: 0.7.2</summary> ## [0.7.2](profiler/v0.7.1...profiler/v0.7.2) (2026-11-25) ### Bug Fixes * **profiler:** Universe resolution improvements ([#20991](#20991)) ([5cec789](5cec789)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.
Closing the outer client (not the individual writers or streams) exposes a condition where we attempt to mark a pending write done more than once, which in this case yields a panic due to double-closure of an associated channel within the pending write.
This PR removes the potential markDone that fires when connection selection fails (related to the transport shutdown), making the finalization of the write a responsibility of the caller. For error cases, that corresponds to the processRetry fn, and for success this is handled in the main connRecvProcessor goroutine loop.
This PR also adds tests to assert behavior under this scenario.
Fixes: #20922