Class RetryEngine

java.lang.Object
com.cockroachlabs.crdb.retry.RetryEngine

public final class RetryEngine extends Object
Executes a unit of work, retrying on retryable CockroachDB anomalies with AdaptiveBackoff. When attempts are exhausted it throws CrdbException carrying a RetryExhausted anomaly.

The engine keeps a persistent AdaptiveBackoff so contention learned from one operation informs the next.

  • Constructor Details

    • RetryEngine

      public RetryEngine()
    • RetryEngine

      public RetryEngine(DoubleSupplier jitterSource, RetryEngine.Sleeper sleeper)
      Parameters:
      jitterSource - optional deterministic jitter source (may be null)
      sleeper - how to wait between attempts (inject a no-op in tests)
  • Method Details