Skip to content

cmd/go: DiskCache.Trim on macOS often blocks go command for >20 minutes #76314

@connorszczepaniak-wk

Description

@connorszczepaniak-wk

Go version

go1.25.4

Output of go env in your module/workspace:

AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE='on'
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN='/Users/connorszczepaniak/.local/share/mise/installs/go/1.25.4/bin'
GOCACHE='/Users/connorszczepaniak/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/connorszczepaniak/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/14/dl88pgbs11766nqnslc5ry8h0000gs/T/go-build3441948075=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/connorszczepaniak/go/src/github.com/Workiva/skaardb/go.mod'
GOMODCACHE='/Users/connorszczepaniak/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/connorszczepaniak/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/connorszczepaniak/.local/share/mise/installs/go/1.25.4'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/connorszczepaniak/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/connorszczepaniak/.local/share/mise/installs/go/1.25.4/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.25.4'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Ran go test -run "TestSomething" ./path/to/package

This also occurs when running go tool sometool, so I suspect it happens any time a build is invoked. Unfortunately I don't have a consistent way to repro, but it happens probably at least once a day.

What did you see happen?

The command hung for a long time (7 minutes 33 seconds) after the test finished. The process appears to have been in a "stuck" state

Image

What did you expect to see?

The command to exit promptly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Darwin

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions