Skip to content

failnext v1.1.0

Latest

Choose a tag to compare

@yermakovsa yermakovsa released this 21 Nov 09:08
· 2 commits to main since this release
b0f2d6a

This release adds configurable per-attempt timeouts and request-scoped timeout overrides.

Use Config.AttemptTimeout to set a timeout for each provider attempt. WithAttemptTimeout lets you override the configured timeout for a request or explicitly disable it by passing zero.

On timeout, failnext cancels the attempt context and waits for Base.RoundTrip to return before applying the normal failover rules. Response-body reads are not timed.

Changes

  • Add per-attempt timeouts through Config.AttemptTimeout
  • Add request-scoped timeout overrides through WithAttemptTimeout
  • Add ErrAttemptTimeout, which also matches context.DeadlineExceeded
  • Add a rate-limit quarantine example using OnEvent and Eligible
  • Add a latency-based quarantine example using attempt durations
  • Improve README documentation for per-attempt timeouts
  • Update OpenTelemetry dependencies in the go-ethereum examples to address a security advisory

Per-attempt timeouts are disabled by default, and existing failover behavior remains unchanged unless a timeout is configured.

The separate examples/goethereum module now requires Go 1.26. The root failnext module's Go requirement remains unchanged.

See the README and examples for usage examples.