Skip to content

x/sync/semaphore: acquire should fail if context is canceled or timed out #63615

@szuecs

Description

@szuecs

What version of Go are you using (go version)?

Issue is also reproducibe in https://go.dev/play/p/CNcJihWeMMU

$ go version
go version go1.21.3 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE='on'
GOARCH='amd64'
GOBIN='/home/sszuecs/go/bin'
GOCACHE='/home/sszuecs/.cache/go-build'
GOENV='/home/sszuecs/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/sszuecs/go/pkg/mod'
GONOPROXY='github.bus.zalan.do'
GONOSUMDB='github.bus.zalan.do'
GOOS='linux'
GOPATH='/home/sszuecs/go'
GOPRIVATE='github.bus.zalan.do'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/share/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/share/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.3'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/sszuecs/tmp/go/semaphore/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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3306102333=/tmp/go-build -gno-r
ecord-gcc-switches'

What did you do?

Reproducible error:
https://go.dev/play/p/CNcJihWeMMU

What did you expect to see?

no error printed

What did you see instead?

2009/11/10 23:00:00 acquire expected to fail on done context

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixPendingIssues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions