You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be a documentation error in client.go...
// Timeout is a cumulative timeout for dial, write and read, defaults to 0 (disabled) - overrides DialTimeout, ReadTimeout,
// WriteTimeout when non-zero. Can be overridden with net.Dialer.Timeout (see Client.ExchangeWithDialer and
// Client.Dialer) or context.Context.Deadline (see ExchangeContext)
From the code, Client.Timeout only overrides Client.DialTimeout. There is also this documentation for Client.ExchangeContext()...
// ExchangeContext acts like Exchange, but honors the deadline on the provided
// context, if present. If there is both a context deadline and a configured
// timeout on the client, the earliest of the two takes effect.
It's awkward if the context deadline is larger than the default dnsTimeout constant of 2s. In that situation, all the client timeouts must be set to a value equal or larger than the context timeout in order to get the desired behavior.
IMO, implementation should be updated to have Client.Timeout behave as documented and supersede Client.DialTimeout + Client.ReadTimeout + Client.WriteTimeout. Additionally, a context deadline should supersede Client.Timeout (or Client.DialTimeout + Client.ReadTimeout + Client.WriteTimeout).
The text was updated successfully, but these errors were encountered:
There seems to be a documentation error in client.go...
From the code, Client.Timeout only overrides Client.DialTimeout. There is also this documentation for Client.ExchangeContext()...
It's awkward if the context deadline is larger than the default dnsTimeout constant of 2s. In that situation, all the client timeouts must be set to a value equal or larger than the context timeout in order to get the desired behavior.
IMO, implementation should be updated to have Client.Timeout behave as documented and supersede Client.DialTimeout + Client.ReadTimeout + Client.WriteTimeout. Additionally, a context deadline should supersede Client.Timeout (or Client.DialTimeout + Client.ReadTimeout + Client.WriteTimeout).
The text was updated successfully, but these errors were encountered: