net/http: racy use of timers in http2Transport #37449
With these strategically-placed sleeps:
I get reliable crashes out of
The crash is a detected race between s.timer.Reset during the request writing goroutine (specifically a delayed body write) and s.timer.Stop during response processing of a 100 Continue header. Full stacks below.
The code is correct except for provoking the race panic. The timer setup is:
The request writing does:
If we get a 100 Continue then we stop the timer and run the function:
where on100 is:
The Stop is cleanup, and fnonce is protecting the actual work.
If we don't remove the panic in #37400 then we need to rewrite this code.
The text was updated successfully, but these errors were encountered:
If we see a racy use of timers, as in concurrent calls to Timer.Reset, do the operations in an unpredictable order, rather than crashing. Updates #37400 Updates #37449 Fixes #37494 Change-Id: Idbac295df2dfd551b6d762909d5040fc532c1b34 Reviewed-on: https://go-review.googlesource.com/c/go/+/221077 Run-TryBot: Ian Lance Taylor <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Michael Knyszek <email@example.com> (cherry picked from commit 98858c4) Reviewed-on: https://go-review.googlesource.com/c/go/+/221298