tl;dr If you use retry.TransientErr
in a retry policy, then unexpected end-of-file errors will be treated as transient errors and retried.
- Added new transient error category
transient.UnexpectedEOF
. - Classify
io.EOF
andio.ErrUnexpectedEOF
astransient.UnexpectedEOF
with the following effects for the retry deciderretry.TransientErr
:- If the underlying
Doer.Do(...)
method fails as a result of anio.EOF
, for example if a remote load balancer decides to throttle a TLS handshake by FIN-ning the connection,retry.TransientErr
will indicate a retry. - If the response body read fails with an
io.ErrUnexpectedEOF
because the remote host closed the connection before all bytes indicated by theContent-Length
response header have been received,retry.TransientErr
will indicate a retry.
- If the underlying
- (minor) Improve some stale
panic
messages. - (minor) Improve some documentation.