I think the definition of "temporary" is the issue here. Something like an 
underlying EAGAN is "temporary" - retrying the same operation that failed on 
the same socket again can succeed. A read error from a closed TCP connection is 
not temporary - reading again cannot possibly unclose the connection and 
suddenly succeed.

However, it not being a temporary error doesn’t mean that larger scale 
operation can never succeed - retrying by making another request can work.

In other words, for your HTTP purposes I don’t think the (*OpError).Temporary() 
is a valuable indicator. You’re probably better off considering known fatal 
HTTP errors as non-temporary (a 404 probably indicates the request won’t 
succeed in 500 ms either, unless you know otherwise) and other errors as 
transient and subject to a retry.

//jb

On 17 Apr 2018, at 06:56, Jens-Uwe Mager 
<juma...@gmail.com<mailto:juma...@gmail.com>> wrote:

Looking further into this, I see this as a typical transient error in a bad 
network on downloading files. It may be different elsewhere, but I have to 
retry on that error as it appears. And I cannot change the network somewhere in 
the Guatemala outback.

On Monday, April 16, 2018 at 4:59:28 PM UTC-6, Ian Lance Taylor wrote:
On Mon, Apr 16, 2018 at 3:09 PM, Jens-Uwe Mager <jum...@gmail.com> wrote:
>
> I am checking net.error for the Temporary() condition, and in my very bad
> network I do see really a lot of errors. While doing a GET request I see
> that
>
> http: unexpected EOF reading trailer
>
> is not a temporary error, so my retry logic does not kick in. Is this a
> special case or just an oversight?

EOF means that the TCP connection has closed, so this error is not temporary.

Ian

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
golang-nuts+unsubscr...@googlegroups.com<mailto:golang-nuts+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to