Skip to content

x/net/http2: When using an http2.Transport with http.Client, TLS-related httptrace callbacks are not invoked #52110

@hawkinsw

Description

@hawkinsw

First, thank you so much for the awesome httptrace functionality! It's a lifesaver. Second, I have a patch that fixes the issue here -- I am submitting an Issue first because

Excluding very trivial changes, all contributions should be connected to an existing issue.

and I want to make sure that I am following best practices. And now, on with the report:

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

$ go version
go version devel go1.19-e72cd2de38 Sun Mar 27 02:50:33 2022 -0400 linux/amd64

Note: Same behavior seen with the "Release" versions of 1.18.

Does this issue reproduce with the latest release?

Yes (see above)

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/hawkinsw/.cache/go-build"
GOENV="/home/hawkinsw/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/hawkinsw/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/hawkinsw/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/hawkinsw/code/gosrc/goroot"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/hawkinsw/code/gosrc/goroot/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel go1.19-e72cd2de38 Sun Mar 27 02:50:33 2022 -0400"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/hawkinsw/code/goresponsiveness/go.mod"
GOWORK=""
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-build3289694319=/tmp/go-build -gno-record-gcc-switches"

What did you do?

A fully buildable and executable program (with flags for eliciting expected and unexpected behavior) is available at

https://github.com/hawkinsw/bugs/tree/main/httptrace

$ go build ./repro.go

To get expected behavior,
$ ./repro

To get unexpected behavior,
$ ./repro -bug

All code (and rationale behind it) in the MRE is commented. I look forward to submitting my (simple) patch and contributing!

I hope that all this information is helpful!
Will

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions