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

net: Dial ignores second result of Context.Deadline() #35594

Closed
g7r opened this issue Nov 14, 2019 · 2 comments
Closed

net: Dial ignores second result of Context.Deadline() #35594

g7r opened this issue Nov 14, 2019 · 2 comments

Comments

@g7r
Copy link
Contributor

@g7r g7r commented Nov 14, 2019

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

$ go version
go version devel +3f21c2381d Thu Nov 14 01:57:00 2019 +0000 linux/amd64

Actually, the issue is pretty old. I've reproduced it on both 1.12 and 1.13 versions.

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=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/sz/.cache/go-build"
GOENV="/home/sz/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/sz/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/sz/src/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/sz/src/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/sz/src/go/src/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-build617450948=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://play.golang.org/p/oMNspjAQkeX

What did you expect to see?

It is expected to get "Connection refused" error.

What did you see instead?

"i/o timeout" is returned.

@g7r

This comment has been minimized.

Copy link
Contributor Author

@g7r g7r commented Nov 14, 2019

I will submit a PR with fix shortly.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 14, 2019

Change https://golang.org/cl/207297 mentions this issue: net: fix improper Context.Deadline usage in DialContext

@gopherbot gopherbot closed this in 7719016 Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.