Function: http.default_retry_predicate

Simple default retry predicate for idempotent targets.

If your target is non-idempotent, use default_retry_predicate_non_idempotent instead.

Retries on 429 (Too Many Requests), 502 (Bad Gateway), 503 (Service unavailable), and 504 (Gateway Timeout), as well as on any ConnectionError, ConnectionFailedError, and TimeoutError.

For more information, see Retry steps.

Arguments

Arguments
exception The error to apply the retry criterion upon.

Returns

true when the retry criterion is satisfied, false otherwise.

Examples

# Make an HTTP request using a standard retry predicate
# and custom maximum retries and backoff parameters
- read_item:
    try:
      call: http.get
      args:
        url: https://example.com/someapi
      result: api_response
    retry:
      predicate: ${http.default_retry_predicate}
      max_retries: 5
      backoff:
        initial_delay: 2
        max_delay: 60
        multiplier: 2