Open gannett-ggreer opened 8 months ago
The query should be the equivalent of datastore.NewQuery("exclusion").Project("ID").Order("ID")
but I haven't verified that. The base context for the .Run
of the query is just context.Background()
.
Edit: It also gets progressively slower and slower to retrieve entries from the query. I'm guessing because it has to walk that massive linked list of contexts to find some value.
Client
Google Firestore in Datastore mode
Environment
Compile: macOS Ventura Run: Linux (GKE pod)
Go Environment
$ go version go version go1.22.0 darwin/amd64
$ go env GO111MODULE='on' GOARCH='amd64' GOBIN='' GOCACHE='/Users/ggreer/Library/Caches/go-build' GOENV='/Users/ggreer/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='amd64' GOHOSTOS='darwin' GOINSECURE='' GOMODCACHE='/Users/ggreer/p/go/pkg/mod' GONOPROXY='github.com/GannettDigital' GONOSUMDB='github.com/GannettDigital' GOOS='darwin' GOPATH='/Users/ggreer/p/go' GOPRIVATE='github.com/GannettDigital' GOPROXY='https://proxy.golang.org,direct' GOROOT='/usr/local/Cellar/go/1.22.0/libexec' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/usr/local/Cellar/go/1.22.0/libexec/pkg/tool/darwin_amd64' GOVCS='' GOVERSION='go1.22.0' GCCGO='gccgo' GOAMD64='v1' AR='ar' CC='cc' CXX='c++' CGO_ENABLED='1' GOMOD='/Users/ggreer/p/go/src/github.com/GannettDigital/sports2-aggregator/go.mod' 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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/Users/ggreer/.tmp/go-build1573180754=/tmp/go-build -gno-record-gcc-switches -fno-common'
Code
There's a lot to the program but the "meat" of the panic is basically this code:
Expected behavior
Datastore client enumerates all 36 million objects.
Actual behavior
Datastore client slowly uses more and more memory until it panics with
runtime: goroutine stack exceeds 1000000000-byte limit
.Additional context
go.mod Google versions:
Stack trace for the crashing goroutine is: