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.EOFandio.ErrUnexpectedEOFastransient.UnexpectedEOFwith 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.TransientErrwill indicate a retry. - If the response body read fails with an
io.ErrUnexpectedEOFbecause the remote host closed the connection before all bytes indicated by theContent-Lengthresponse header have been received,retry.TransientErrwill indicate a retry.
- If the underlying
- (minor) Improve some stale
panicmessages. - (minor) Improve some documentation.