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: DialContext returns "dial tcp <addr>: context deadline exceeded" error #23648

Closed
benburkert opened this issue Feb 1, 2018 · 3 comments
Closed

Comments

@benburkert
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

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

go version go1.9.3 linux/amd64

Does this issue reproduce with the latest release?

yes

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build672889649=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

A reverse proxy triggered a bunch of dial timeouts while connecting to a backend over a short period of time.

What did you expect to see?

A bunch of "dial tcp <addr>: i/o timeout" error messages.

What did you see instead?

A reverse proxy logged a quick burst of "dial tcp <addr>: context deadline exceeded" errors. The errors originated from the DialContext method a *net.Dialer with a Timeout value set.

@benburkert
Copy link
Contributor Author

benburkert commented Feb 1, 2018

My guess is that the context.DeadlineExceeded message is in the error string because mapErr isn't being called here. But I haven't been able to reproduce the error message locally.

@ianlancetaylor
Copy link
Contributor

Closing as dup of #22724.

@gopherbot
Copy link

Change https://golang.org/cl/103518 mentions this issue: net: map context errors from aborted dial to internal net package errors

gopherbot pushed a commit that referenced this issue Mar 29, 2018
Map the error returned when a dial is aborted from the context package
error to the internal net package error. For example, context.Canceled
errors map to errCanceled, and context.DeadlineExceeded errors map to
poll.ErrTimeout.

Fixes #23648

Change-Id: Idf9d3d08052d540740c0b054503aaed931dc5b1e
Reviewed-on: https://go-review.googlesource.com/103518
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Mar 29, 2019
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