Data race in managedwriter.(*connection).lockingAppend() #9301
Labels
api: bigquery
Issues related to the BigQuery API.
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Client
bigquery/storage (v1.58.0)
Environment
Any
Go Environment
$ go version
1.21.6
$ go env
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.6'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1646458025=/tmp/go-build -gno-record-gcc-switches'
Code
It happened so far only once in a bigger code base. The below snippet is a simplified version. For this I was not able to reproduce it, but from the stack trace it should be clear what happened.
e.g.
We ran this with the "race" flag of golang.
Expected behavior
No data race is detected.
Actual behavior
go reports the following data race:
See
https://github.com/googleapis/google-cloud-go/blob/bigquery/v1.58.0/bigquery/storage/managedwriter/connection.go#L485
https://github.com/googleapis/google-cloud-go/blob/bigquery/v1.58.0/bigquery/storage/managedwriter/connection.go#L447
The text was updated successfully, but these errors were encountered: