Sometimes requests fail. When these requests fail for transient issues, Ambassador Edge Stack can automatically retry the request.
Retry policy can be set for all Ambassador Edge Stack mappings in the
ambassador Module, or set per
Mapping. Generally speaking, you should set
retry_policy on a per mapping basis. Global retries can easily result in unexpected cascade failures.
Note that when setting
max_retriesin the circuit breaker configuration should also be considered in order to account for all desired retries.
retry_policy attribute configures automatic retries. The following fields are supported:
retry_policy:retry_on: <string>num_retries: <integer>per_try_timeout: <string>
(Required) Specifies the condition under which Ambassador Edge Stack retries a failed request.
|Retries if the upstream service responds with any 5xx code or does not respond at all|
|Similar to a |
|Retries on a connection failure to the upstream service (included in |
|Retries on a retriable 4xx response (currently only 409)|
|Retires if the upstream service sends a REFUSED_STREAM error (included in |
|Retries based on status codes set in the |
For more details on each of these values, see the Envoy documentation.
(Default: 1) Specifies the number of retries to execute for a failed request.
(Default: global request timeout) Specify the timeout for each retry. Must be in seconds or nanoseconds, e.g.,
A per mapping retry policy:
---apiVersion: getambassador.io/v3alpha1kind: Mappingmetadata:name: quote-backendspec:hostname: '*'prefix: /backend/service: quoteretry_policy:retry_on: "5xx"num_retries: 10
A global retry policy (not recommended):
---apiVersion: getambassador.io/v3alpha1kind: Modulemetadata:name: ambassadorspec:config:retry_policy:retry_on: "retriable-4xx"num_retries: 4---apiVersion: getambassador.io/v3alpha1kind: Mappingmetadata:name: quote-backendspec:prefix: /backend/service: quotehostname: '*'