Changelog
Notable changes to relay. This project follows semantic versioning; the v1 line keeps the documented API stable.
v1.2.1
2025-05-12 Fix- Fixed a race in the breaker's half-open probe where two concurrent calls could both be admitted under high contention.
- Corrected backoff overflow when
Basewas very large and the attempt count was high; the computed delay now saturates atMaxinstead of wrapping.
v1.2.0
2025-04-28 Feature- Added
Client.State()to inspect the current breaker state for health checks and metrics. - Added
EqualJitteras a built-inJitterFunc. - Documented the body-rewind requirement for retrying non-standard request bodies.
v1.1.3
2025-03-09 Fix- Per-attempt timeout is now correctly cancelled after each attempt, fixing a context leak observed under sustained load.
- Minor documentation fixes in the configuration guide.
v1.1.2
2025-02-17 FixRetryIdempotentno longer retries POST requests that were misclassified when a custom method string was used.- Reduced allocations on the non-retry fast path.
v1.1.0
2025-01-22 Feature- Added
ConstantBackofffor fixed-delay retry schedules. ErrExhaustednow wraps the final underlying error soerrors.Unwrapreveals the last cause.- The breaker's
SuccessThresholdis now configurable (previously fixed at 1).
v1.0.1
2024-12-30 Fix- Fixed a nil-pointer panic when
RetryPolicy.RetryOnwas left nil; it now falls back toRetryIdempotentas documented.
v1.0.0
2024-12-03 Feature Breaking- First stable release. The v1 API is now frozen.
- Breaking:
Newtakes functional options instead of aConfigstruct. Migraterelay.NewWithConfig(cfg)to the equivalentWith*options. - Breaking:
Client.Donow takescontext.Contextas its first parameter. - Established the three-layer model: breaker, then retry, then per-attempt timeout.
v0.5.2
2024-10-15 Fix- Full jitter is now applied correctly; earlier builds applied jitter to only the first retry.
- Clarified that clients are safe for concurrent use.
v0.5.0
2024-09-27 Feature- Introduced the circuit breaker with closed/open/half-open states.
- Added
WithCircuitBreakerandErrCircuitOpen.
v0.4.1
2024-08-19 Fix- Backoff now respects the parent context deadline instead of sleeping past it.
v0.4.0
2024-07-30 Feature- Added the
Backoffinterface withExponentialBackoffand pluggable jitter. - Request bodies are rewound via
GetBodybefore each retry.
v0.3.0
2024-06-24 Feature- Added per-attempt timeouts via
WithTimeout. - Added the
RetryIdempotentandRetryNeverclassifiers.
v0.2.0
2024-06-02 Feature- Added bounded retries with a fixed delay.
GetandPostconvenience helpers.
v0.1.0
2024-05-14 Feature- Initial public release: a thin wrapper over
net/httpwith a singleDomethod and a configurable transport.