<@U04S8PLJWMT>, How to increase delay for each ret...
# ask-ai
k
@kapa.ai, How to increase delay for each retry attempt?
k
To increase the delay for each retry attempt in Airbyte, you should use the Exponential Backoff strategy. This strategy increases the wait time exponentially with each retry attempt. The delay is calculated as:
Copy code
delay = factor * 2^attempt_count
- factor: The base number of seconds to wait, which you can configure. - attempt_count: The number of the current retry attempt (starting from 0). For example, if you set the factor to 5, the delays for each attempt will be 5, 10, 20, 40, 80 seconds, etc. How to configure: - In the connector builder or YAML config, set the
factor
property in the ExponentialBackoffStrategy. - If you want a larger delay, increase the
factor
value. Example configuration:
Copy code
yaml backoff_strategies:   - type: "ExponentialBackoffStrategy"     factor: 10  # This will double the delay each time, starting from 10 seconds
If you do not specify a backoff strategy, Airbyte defaults to exponential backoff with a default factor of 5 seconds. You can also use a value from your connector configuration if needed. For more details, see the documentation on [Exponential Backoff Strategy](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/error-handling#exponential) and the YAML reference for [ExponentialBackoffStrategy](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/ExponentialBackoffStrategy). If you want a fixed delay for each retry, use the Constant backoff strategy and set the desired number of seconds. Example for constant backoff:
Copy code
yaml backoff_strategies:   - type: "ConstantBackoffStrategy"     backoff_time_in_seconds: 30
This will wait 30 seconds between each retry attempt, regardless of the attempt number. Summary: - Use ExponentialBackoffStrategy and increase the
factor
to increase delay exponentially. - Use ConstantBackoffStrategy to set a fixed delay. References: [Exponential Backoff Strategy](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/error-handling#exponential), [YAML Reference](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/ExponentialBackoffStrategy)
k
@kapa.ai Can we update this values.yaml?
Copy code
backoff_strategies:
  - type: "ConstantBackoffStrategy"
    backoff_time_in_seconds: 30
k
A message from kapa.ai
Yes, you can update the
values.yaml
(or your connector's YAML configuration) to change the backoff strategy and its parameters. For example, to set a constant backoff of 30 seconds between retries, your configuration is correct:
Copy code
yaml backoff_strategies:   - type: "ConstantBackoffStrategy"     backoff_time_in_seconds: 30
The
backoff_time_in_seconds
property accepts a numeric value (like
30
), a decimal (like
30.5
), or even a string referencing a value from your connector configuration (e.g.,
{{ config['backoff_time'] }}
) if you want it to be dynamic. This is supported across Airbyte versions and is documented in the YAML reference for the
ConstantBackoffStrategy
object [ConstantBackoffStrategy object](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/ConstantBackoffStrategy). So, you can safely update your YAML as shown above to control the retry delay.
k
@kapa.ai We want to update this in Airbyte instance level, instead of each connector. Retry State: RetryManager(completeFailureBackoffPolicy=BackoffPolicy(minInterval=PT10S, maxInterval=PT30M, base=3)
k
A message from kapa.ai
To update the retry backoff policy at the Airbyte instance level (not per connector), you need to configure environment variables related to job retries. According to the documentation, the relevant environment variables are: -
SYNC_JOB_RETRIES_COMPLETE_FAILURES_BACKOFF_MIN_INTERVAL_S
-
SYNC_JOB_RETRIES_COMPLETE_FAILURES_BACKOFF_MAX_INTERVAL_S
-
SYNC_JOB_RETRIES_COMPLETE_FAILURES_BACKOFF_BASE
These control the minimum and maximum backoff intervals (in seconds) and the exponential base for the backoff calculation for complete failures across all sync jobs in your Airbyte instance. Example: To set a minimum backoff of 30 seconds, a maximum of 1 hour, and a base of 2, you would set:
Copy code
env SYNC_JOB_RETRIES_COMPLETE_FAILURES_BACKOFF_MIN_INTERVAL_S=30 SYNC_JOB_RETRIES_COMPLETE_FAILURES_BACKOFF_MAX_INTERVAL_S=3600 SYNC_JOB_RETRIES_COMPLETE_FAILURES_BACKOFF_BASE=2
Set these environment variables in your Airbyte deployment (e.g., in your
docker-compose.yaml
, Kubernetes manifests, or wherever you manage Airbyte environment variables). Note: This will apply the retry backoff policy globally to all sync jobs, not just a specific connector. For more details, see the [Configuring Airbyte: Jobs section](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs). If you need to adjust partial failure retries, there are similar environment variables for those as well. --- Summary: Update the relevant environment variables at the instance level to control retry backoff for all jobs, rather than editing each connector’s YAML individually. [Configuring Airbyte: Jobs](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs)