Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCPListener.Close() can't works #43895

Closed
zwtop opened this issue Jan 25, 2021 · 1 comment
Closed

TCPListener.Close() can't works #43895

zwtop opened this issue Jan 25, 2021 · 1 comment

Comments

@zwtop
Copy link

zwtop commented Jan 25, 2021

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

$ go version
go version go1.15.6 linux/amd64

Does this issue reproduce with the latest release?

maybe

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/opt/golang/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/opt/golang"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/opt/golang/src/github.com/ofnet/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build063384986=/tmp/go-build -gno-record-gcc-switches"

What did you do?

When I run my test case, it's timeout while close TCPListener. Under what circumstances will it be unable to close TCPListener?
This is the stack of go test.

goroutine 51 [semacquire, 10 minutes]:
internal/poll.runtime_Semacquire(0xc000397828)
	/opt/hostedtoolcache/go/1.14.13/x64/src/runtime/sema.go:61 +0x42
internal/poll.(*FD).Close(0xc000397800, 0xc000397800, 0x0)
	/opt/hostedtoolcache/go/1.14.13/x64/src/internal/poll/fd_unix.go:109 +0x8f
net.(*netFD).Close(0xc000397800, 0x44, 0x1)
	/opt/hostedtoolcache/go/1.14.13/x64/src/net/fd_unix.go:184 +0x4f
net.(*TCPListener).close(...)
	/opt/hostedtoolcache/go/1.14.13/x64/src/net/tcpsock_posix.go:156
net.(*TCPListener).Close(0xc000b33460, 0xc0000b1dc8, 0x3)
	/opt/hostedtoolcache/go/1.14.13/x64/src/net/tcpsock.go:274 +0x5e
github.com/osrg/gobgp/server.(*TCPListener).Close(0xc000e8b4f0, 0xc0003e4540, 0xc000d937d0)
	/home/runner/work/ofnet/ofnet/vendor/github.com/osrg/gobgp/server/server.go:45 +0x43
github.com/osrg/gobgp/server.(*BgpServer).Stop.func1(0xc0000c8000, 0xc0000c8000)
	/home/runner/work/ofnet/ofnet/vendor/github.com/osrg/gobgp/server/server.go:1359 +0x177
github.com/osrg/gobgp/server.(*BgpServer).handleMGMTOp(0xc0003b3000, 0xc000e8fa40)
	/home/runner/work/ofnet/ofnet/vendor/github.com/osrg/gobgp/server/server.go:163 +0x47
github.com/osrg/gobgp/server.(*BgpServer).Serve(0xc0003b3000)
	/home/runner/work/ofnet/ofnet/vendor/github.com/osrg/gobgp/server/server.go:283 +0x8b8
created by github.com/contiv/ofnet.createBgpServer
	/home/runner/work/ofnet/ofnet/ofnetBgp.go:559 +0x55
@mvdan
Copy link
Member

mvdan commented Jan 25, 2021

The Go project doesn't use the issue tracker for questions. See https://golang.org/wiki/Questions.

@mvdan mvdan closed this as completed Jan 25, 2021
@golang golang locked and limited conversation to collaborators Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants