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

Changelog History
Page 3

  • v2.3.0 Changes

    August 16, 2019

    Behavior Changes

    • FailsafeExecutor.get and FailsafeExecutor.run will no longer wrap Error instances in FailsafeException before throwing.

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  Fixed potential race between Timeout interrupts and execution completion.
  • v2.2.0 Changes

    August 12, 2019

    ๐Ÿ‘Œ Improvements

    • โž• Added a new Timeout policy that fails with TimeoutExceededException.
    • โž• Added ExecutionContext.isCancelled().
    • โž• Added ExecutionContext.getElapsedAttemptTime().
    • โฑ Made the internal delay scheduler more adaptive.

    API Changes

    • ๐Ÿ—„ Deprecated CircuitBreaker.withTimeout in favor of using a separate Timeout policy.

    ๐Ÿ› Bug Fixes

    • ๐Ÿ”€ Reset interrupt flag when a synchronous execution is interrupted.
    • ๐Ÿ‘Œ Improved handling around externally completing a Failsafe CompletableFuture.
  • v2.1.1 Changes

    July 29, 2019

    ๐Ÿ‘Œ Improvements

    • โž• Added support for CircuitBreaker.withDelay(DelayFunction)
    • โž• Added Fallback.ofException for returning custom exceptions.
    • โž• Added ExecutionContext.getLastResult and .getLastFailure to support retries that depend on previous executions
    • โž• Added CircuitBreakerOpenException.getCircuitBreaker

    API Changes

    • ๐Ÿ“ฆ RetryPolicy.DelayedFunction was moved to the net.jodah.failsafe.function package.
    • โœ‚ Removed RetryPolicy.canApplyDelayFn
  • v2.1.0 Changes

    July 20, 2019

    ๐Ÿ‘Œ Improvements

    • โž• Added support for Failsafe.with(List<Policy<R>>).
    • ๐Ÿ‘ Allow null Fallback values.

    ๐Ÿ› Bug Fixes

    • Issue #190 - Failure listener called on success for async executions.
    • Issue #191 - Add missing listeners to RetryPolicy copy constructor.
    • Issue #192 - Problem with detecting completion when performing async execution.

    Behavior Changes

    • A standalone or async execution will only be marked as complete when all policies are complete. Execution.isComplete reflects this.
  • v2.0.1 Changes

    February 03, 2019

    ๐Ÿ‘Œ Improvements

    • โž• Added support for using ExecutorService via FailsafeExecutor.with(ExecutorService).
    • โž• Added interruptable cancellation for executions ran on ForkJoinPool via CompletableFuture.cancel(true).

    ๐Ÿ› Bug Fixes

    • Issue #171 - Handle completed futures when using getStageAsync.
  • v2.0 Changes

    ๐Ÿ‘Œ Improvements

    • ๐Ÿ‘ [Policy composition](README.md#policy-composition) is now supported.
    • [A Policy SPI](README.md#policy-spi) is now available.
    • โฑ Async execution is now supported without requiring that a ScheduledExecutorService or Scheduler be configured. When no scheduler is configured, the ForkJoinPool's common pool will be used by default.
    • ๐Ÿ‘ Fallback now support async execution via ofAsync.
    • ๐Ÿ‘€ CircuitBreaker supports execution metrics (see below).
    • ๐Ÿ‘ Strong typing based on result types is supported throughout the API.

    Behavior Changes

    • 0๏ธโƒฃ RetryPolicy now has 3 max attempts by default.
    • 0๏ธโƒฃ CircuitBreaker now has a 1 minute delay by default.

    JRE Changes

    • Java 8+ is now required

    API Changes

    Failsafe 2.0 includes a few API changes from 1.x that were meant to consolidate behavior such as the execution APIs, which are now based on common Policy implementations, while adding some new features such as Policy composition.

    • Policies
      • Policy implementations now take a type parameter R that represents the expected result type.
      • Some of the time related policy configurations have been changed to use Duration instead of long + TimeUnit.
    • ๐Ÿ”ง Policy configuration
      • Multiple policies can no longer be configured by chaining multiple Failsafe.with calls. Instead they must be supplied in a single Failsafe.with call. This is was intentional to require users to consider the ordering of composed policies. See the README section on [policy composition](README.md#policy-composition) for more details.
    • RetryPoilicy
      • The retryOn, retryIf, and retryWhen methods have been replace with handleOn, etc.
    • CircuitBreaker
      • The failOn, failIf, and failWhen methods have been replace with handleOn, etc.
    • Fallbacks
      • Fallbacks must be wrapped in a Fallback instance via Fallback.of
    • Failsafe APIs
      • Suppliers are now used instead of Callables.
      • java.util.function.Predicate is used instead of Failsafe's internal Predicate.
      • withFallback is no longer supported. Instead, Failsafe.with(fallback...) should be used.
    • Async execution
      • Async execution is now performed with the getAsync, runAsync, getStageAsync, etc. methods.
      • Async API integration is now supported via the getAsyncExecution, runAsyncExecution, etc. methods.
    • Event listeners
      • Event listeners now all consume a single ExecutionEvent object, which includes references to the result, failure, and other information.
      • Event listeners that are specific to policies, such as onRetry for RetryPolicy, must now be configured through the policy instance. The top level Failsafe API only supports onComplete, onSuccess, and onFailure. Individual Policy implementations still support onSuccess and onFailure in addition to policy specific events.
      • The top level Failsafe.onSuccess event listener will only be called if all configured policies consider an execution to be successful, otherwise onFailure will be called.
      • The Listeners class was removed, since it was mostly intended for Java 6/7 users.
      • The async event listener APIs were removed. Events will always be delivered in the same thread as the execution that they follow or preceed, including for async executions.
    • Java 8
      • java.time.Duration is used instead of Failsafe's own Duration impl.
      • ChronoUnit is used instead of TimeUnit in policies.
    • ExecutionContext.getExecutions is now getAttemptCount.
    • โฑ Schedulers.of(ScheduledExecutorService) was moved to the Scheduler interface.

    API Additions

    • CircuitBreaker
      • preExecute is now exposed to support standalone usage.
      • Execution metrics are available via getFailureCount, getFailureRatio, getSuccessCount, and getSuccessRatio.

    ๐Ÿ› Bug Fixes

    • Issue #152 - Min/max delay was not being computed correctly
  • v1.1.1

    November 23, 2018
  • v1.1.0 Changes

    April 06, 2018

    ๐Ÿ› Bug Fixes

    • Issue #115 - Jitter bigger than Delay causes a (random) failure at runtime
    • Issue #116 - Setting jitter without a delay works fine bug
    • Issue #123 - Ability to reset the jitterFactor

    ๐Ÿ‘Œ Improvements

    • ๐Ÿ‘ Issue #110 - Added support for computed delays: RetryPolicy.withDelay(DelayFunction)
    • ๐Ÿ‘ Issue #126 - Added support for random delays: RetryPolicy.withDelay(1, 10, TimeUnit.MILLISECONDS)
  • v1.0.5 Changes

    January 10, 2018

    ๐Ÿ› Bug Fixes

    • Issue #97 - Should not increment exponential backoff time on first attempt
    • Issue #92 - handleRetriesExceeded called incorrectly.
  • v1.0.4 Changes

    April 02, 2017

    API Changes

    • ๐Ÿ‘€ Asynchronous execution attempts no longer throw CircuitBreakerOpenException if a configured CircuitBreaker is open when an execution is first attempted. Instead, the resulting Future is completed exceptionally with CircuitBreakerOpenException. See issue #84.

    ๐Ÿ‘Œ Improvements

    • ๐Ÿ”ง Issue #81 - Added single argument failure configuration to avoid varargs related warnings.