Backoff and retry#

When a reconciler fails (Fail/FailWithError, or returns an error), genop applies exponential backoff with jitter:

  • Base delay: 5 seconds
  • Max delay: 1 hour
  • Factor: 2x per retry
  • Jitter: 25%

The retryIndex in status tracks consecutive failures and resets to 0 on success.

Per-resource configuration#

Set it from .genop.yaml’s operator: block at creation time, or later with genop set operator:

resources:
  - version: v1alpha1
    kind: Database
    operator:
      backoff:
        baseDelay: 10s     # default 5s
        maxDelay: 30m      # default 1h
        factor: 1.5        # default 2.0
        jitterRatio: 25    # 1-100; default 25 (percent). 0 keeps the default

After hand-editing the file, run genop apply to regenerate the wiring. genop set operator does the same in one command — it updates the topology and applies:

genop set operator -p postgresql -c database -a v1alpha1 -k Database \
  --backoff-base-delay 10s --backoff-max-delay 30m

jitterRatio accepts 1-100. A 0 is not “no jitter”: it clears the field and keeps the runtime default of 25. Disabling jitter entirely is only reachable through the Configure<Kind>Operator escape hatch:

func ConfigureDatabaseOperator(
    b *operators.OperatorBuilder[*v1alpha1.DatabaseStatus, *v1alpha1.Database],
) *operators.OperatorBuilder[*v1alpha1.DatabaseStatus, *v1alpha1.Database] {
    return b.WithBackoffJitterRatio(0)
}