The race occurs rarely, but by putting some delays and more reads/writes
of prePendingDial/postPendingDial in the handlePendingDial function I
could reproduce it.
Fixes #11136
Change-Id: I8da9e66c88fbda049eaaaaffa2717264ef327768
Reviewed-on: https://go-review.googlesource.com/11250
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
}
dialc := make(chan dialRes)
+ // Copy these hooks so we don't race on the postPendingDial in
+ // the goroutine we launch. Issue 11136.
+ prePendingDial := prePendingDial
+ postPendingDial := postPendingDial
+
handlePendingDial := func() {
if prePendingDial != nil {
prePendingDial()