bigquery/storage/managedwriter: Potential deadlock on error of ManagedStream in AppendRows #8505
Labels
api: bigquery
Issues related to the BigQuery API.
priority: p1
Important issue which blocks shipping the next release. Will be fixed prior to next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Client
BigQuery
Environment
local
Go Environment
any go env
Code
https://github.com/googleapis/google-cloud-go/blob/bigquery/v1.54.0/bigquery/storage/managedwriter/managed_stream.go#L293-L297
Expected behavior
The managed writer should check an error and release the lock
Actual behavior
If an error case is detected on the ManagedStream we return early and will not release the mutex. Other writers using this stream will deadlock.
Suggested Fix
EDIT: The same issue can be seen here in appendWithRetry
https://github.com/googleapis/google-cloud-go/blob/bigquery/v1.54.0/bigquery/storage/managedwriter/managed_stream.go#L199-L203
The text was updated successfully, but these errors were encountered: