All Versions
53
Latest Version
Avg Release Cycle
87 days
Latest Release
-

Changelog History
Page 1

  • v3.3.0 Changes

    API Changes

    • ExecutionContext.getStartTime now returns a Instant rather than Duration, and ExecutionEvent.getStartTime now returns Optional<Instant>.
    • ๐Ÿšš getFailure, getLastFailure, recordFailure and similar methods for recording Exceptions, which were previously deprecated, were removed. Use getException, getLastException, recordException, etc. instead.
  • v3.2.4 Changes

    ๐Ÿ‘Œ Improvements

    • โž• Added additional thread safety checks.
  • v3.2.3 Changes

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  Fixed an issue where Timeouts would not fire under certain conditions when used outside a RetryPolicy.
  • v3.2.2 Changes

    ๐Ÿ‘Œ Improvements

    • ๐Ÿš€ Released OkHttp module.
    • ๐Ÿš€ Released Retrofit module.
    • โž• Added Call support to FailsafeExecutor, which can cancel synchrnous calls.
    • โž• Added onCancel callback to ExecutionContext, which can propagate cancellations.

    SPI Changes

    • ๐Ÿ”€ SyncExecutionInternal.isInterruptable() and .setInterrupted were removed and .interrupt() was added instead to simplify performing an interruption.
  • v3.2.1 Changes

    ๐Ÿ‘Œ Improvements

    • ๐Ÿ‘ Issue #326 - Added support for reserving a RateLimiter permit with a wait time.

    API Changes

    • ๐Ÿ”ง Deprecated ExecutionContext.getLastFailure, Execution.recordFailure and similar methods throughout that API that refer to exceptions as failures. In their place, new methods have been added, such as getLastException, recordException and so on. This clarifies the difference between an exception and a failure, since an exception may or may not be a failure, depending on the policy configuration.
    • ๐Ÿ”„ Changed the policy builders to use CheckedPredicate and CheckedBiPredicate instead of Predicate and BiPredicate, allowing exceptions to be thrown which are ignored.
  • v3.2.0 Changes

    ๐Ÿ‘Œ Improvements

    • Issue #309 - Introduced a Bulkhead policy.
    • Issue #318 - Add non-blocking async waiting for rate limiters.

    SPI Changes

    • ๐Ÿ‘ PolicyExecutor.preExecuteAsync was introduced to support async pre-execution. This is backwards compatible with preExecute.
  • v3.1.0 Changes

    ๐Ÿ‘Œ Improvements

    • Issue #308 - Introduced a RateLimiter policy.
  • v3.0.2 Changes

    ๐Ÿ› Bug Fixes

    • Issue #311 - with(Executor) not working as expected in some cases.
  • v3.0.1 Changes

    ๐Ÿ‘Œ Improvements

    • ๐Ÿ— Issue #310 - Added .builder(PolicyConfig) methods to each of the policy interfaces, to allow new policies to be built from existing config.
    • ๐Ÿ”ง Issue #251 - Relaxed the illegal state validation in RetryPolicyBuilder to allow different types of delays to be configured, replacing previous configuration. Also removed the requirement that a jitter duration be configured after a delay.

    ๐Ÿ› Bug Fixes

    • Issue #215 - Added overflow checking for large user-provided Duration values.
  • v3.0 Changes

    API Changes

    ๐Ÿš€ This release introduces some breaking changes to the API:

    General

    • โšก๏ธ The maven group id for Failsafe has changed to dev.failsafe. Be sure to update your build config.
    • โšก๏ธ All files have been moved to the dev.failsafe package. Be sure to update your imports.

    Policies

    • ๐Ÿ— All policies now use a builder API. Using the builder API mostly requires inserting builder() and build() methods into the call chain for constructing a policy since the actual with configuration methods are mostly the same as in 2.x policies, with a few changes described below. Some notes:
      • A policy builder can be created via builder(), ex: RetryPolicy.builder().
      • RetryPolicy and CircuitBreaker can also be constructed with default values using ofDefaults().
      • Fallback and Timeout offer additional factory methods for creating a a policy with only their required arguments, without using a builder, ex: Timeout.of(Duration.ofSeconds(10)). Optional arguments must be specified through a builder, ex: Timeout.builder(duration).withInterrupt().build().
      • Policy configuration is now accessible via a policy.getConfig().

    RetryPolicy and CircuitBreaker

    • In RetryPolicyBuilder and CircuitBreakerBuilder:
      • withDelay has been renamed to withDelayFn.
      • withDelayOn has been renamed to withDelayFnOn.
      • withDelayWhen has been renamed to withDelayFnWhen.
      • The above method signatures have also been changed to accept a ContextualSupplier instead of a DelayFunction, since it provides access to the same information.

    CircuitBreaker

    • onOpen, onClose, and onHalfOpen methods now accept a CircuitBreakerStateChangedEvent argument.
    • ๐Ÿšš allowsExecution() was removed in favor of acquirePermit() and tryAcquirePermit(), which are meant for standalone CircuitBreaker usage.

    Fallback

    • ๐Ÿšš The Fallback async factory methods have been removed in favor of a FallbackBuilder.withAsync() option.

    โฑ Timeout

    • โฑ Timeout.withInterrupt(boolean) is now TimeoutBuilder.withInterrupt().

    Execution and AsyncExecution

    • The standalone Execution API, and the AsyncExecution API created via the FailsafeExecutor.runAsyncExecution and getAsyncExecution methods, have been unified to include:
      • record(R, Throwable)
      • recordResult(R)
      • recordException(Throwable)
      • complete()
    • ๐Ÿšš The previously supported Execution and AsyncExecution methods for recording a result have been removed. The methods for performing a retry have also been removed. For Execution, isComplete will indicate whether the execution is complete else if retries can be performed. For AsyncExecution retries will automatically be performed, if possible, immediately after a result or failure is recorded.
    • The Execution constructor is no longer visible. Execution instances must now be constructed via Execution.of(policies).
    • Execution.getWaitTime() was renamed to getDelay().

    Failsafe class

    • ๐Ÿšš Failsafe.with(P[] policies) was removed in favor of Failsafe.with(P, P...). This should only affect users who were explicitly passing an array to Failsafe.with.

    SPI Changes

    โฑ The following changes effect the SPI classes, for users who are extending Failsafe with custom schedulers or policies:

    • โฑ Scheduler and DefauledScheduledFuture were moved to the spi package.
    • ๐Ÿ“ฆ Policy and PolicyExecutor were moved to the spi package and some method signatures changed.
    • ๐Ÿ“ฆ ExecutionResult was moved to the spi package and made generic.
    • ๐Ÿ“ฆ Several new classes were added to the spi package to contain internal execution APIs including ExecutionInternal, SyncExecutionInternal, and AsyncExecutionInternal.
    • ๐Ÿ“ฆ FailsafeFuture was moved to the SPI package and some method signatures changed.

    ๐Ÿ› Bug Fixes

    • ๐Ÿ‘Œ Improved the reliability of async executions, cancellations, and Timeouts.

    ๐Ÿ‘Œ Improvements

    • ๐Ÿ— Issue #47 - All policies and policy config classes are now threadsafe. Policy builders are not threadsafe.
    • ๐Ÿ— Issue #201 - Thread safety is clearly documented in policy, policy config, and policy builder classes.
    • Issue #292 - Created an extensible Policy SPI.
    • Issue #254 - Added an explicit compose method to FailsafeExecutor.
    • Issue #293 - Added RetryPolicyBuilder.withBackoff(Duration, Duration) and .withDelay(Duration, Duration).
    • โฑ Issue #221 - Executor instances configured via FailsafeExecutor.with(Executor) are now used on all executions, including sync executions, and can be used in conjunction with a separately configured ExecutorService or Scheduler for async executions.
    • โž• Added FailsafeExecutor.getPolicies().
    • โž• Added isFirstAttempt() and isRetry() to ExecutionAttempt, which is available via a few event listeners.