net/http: Post http://example.com: net/http: HTTP/1 transport connection broken: readLoopPeekFailLocked: EOF #15446
Please answer these questions before submitting your issue. Thanks!
Send HTTP POST requests to a host that seems to close the connection some specific time after the response. We see the error
It's hard to debug on live traffic and I haven't been able to reproduce this in a clean example.
The error seems to come from
I'm guessing the connection is closed after a request. Because
Is there any debugging (logging things) I can do on the live traffic to help find this bug?
The text was updated successfully, but these errors were encountered:
… failure From at least Go 1.4 to Go 1.6, Transport.RoundTrip would return the error value from net.Conn.Read directly when the initial Read (1 byte Peek) failed while reading the HTTP response, if a request was outstanding. While never a documented or tested promise, Go 1.7 changed the behavior (starting at https://golang.org/cl/23160). This restores the old behavior and adds a test (but no documentation promises yet) while keeping the fix for spammy logging reported in #15446. This looks larger than it is: it just changes errServerClosedConn from a variable to a type, where the type preserves the underlying net.Conn.Read error, for unwrapping later in Transport.RoundTrip. Fixes #16465 Change-Id: I6fa018991221e93c0cfe3e4129cb168fbd98bd27 Reviewed-on: https://go-review.googlesource.com/25153 Reviewed-by: Andrew Gerrand <email@example.com> Reviewed-by: Ian Lance Taylor <firstname.lastname@example.org> Run-TryBot: Brad Fitzpatrick <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org>