From d91f50818df483598b3202a28c67b24ad855dacb Mon Sep 17 00:00:00 2001 From: Anton Troshin Date: Thu, 19 Sep 2024 17:52:03 -0500 Subject: [PATCH 1/8] Add HTTP and gRPC error codes retries to the resiliency policies documentation Signed-off-by: Anton Troshin --- .../en/operations/resiliency/policies.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/daprdocs/content/en/operations/resiliency/policies.md b/daprdocs/content/en/operations/resiliency/policies.md index 086ca7fd5..61b3c3267 100644 --- a/daprdocs/content/en/operations/resiliency/policies.md +++ b/daprdocs/content/en/operations/resiliency/policies.md @@ -49,6 +49,15 @@ The following retry options are configurable: | `duration` | Determines the time interval between retries. Only applies to the `constant` policy.
Valid values are of the form `200ms`, `15s`, `2m`, etc.
Defaults to `5s`.| | `maxInterval` | Determines the maximum interval between retries to which the `exponential` back-off policy can grow.
Additional retries always occur after a duration of `maxInterval`. Defaults to `60s`. Valid values are of the form `5s`, `1m`, `1m30s`, etc | | `maxRetries` | The maximum number of retries to attempt.
`-1` denotes an unlimited number of retries, while `0` means the request will not be retried (essentially behaving as if the retry policy were not set).
Defaults to `-1`. | +| `matching.httpStatusCodes` | Optional: a comma-separated string of HTTP status codes or code ranges to retry. Status codes not listed are not retried.
Valid values: 100-599, [Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
Format: `` or range `-`
Example: "429,501-503"
Default, the empty string `""` or field not set, will retry on all HTTP errors. | +| `matching.gRPCStatusCodes` | Optional: a comma-separated string of gRPC status codes or code ranges to retry. Status codes not listed are not retried.
Valid values: 0-16, [Reference](https://grpc.io/docs/guides/status-codes/)
Format: `` or range `-`
Example: "1,501-503"
Default, the empty string `""` or field not set, will retry on all gRPC errors. | + + +{{% alert title="httpStatusCodes and gRPCStatusCodes format" color="warning" %}} +The field values should follow the format as specified in the field description or in the "Example 2" below. +Incorrectly formatted field value will cause the failure to load the policy and intentional failure to start `daprd`. +{{% /alert %}} + The exponential back-off window uses the following formula: @@ -77,7 +86,20 @@ spec: maxRetries: -1 # Retry indefinitely ``` +Example 2: +```yaml +spec: + policies: + retries: + retry5xxOnly: + policy: constant + duration: 5s + maxRetries: 3 + matches: + httpStatusCodes: "429,500-599" # retry HTTP status codes in range, the rest will not be retried + gRPCStatusCodes: "1-4,8-11,13,14" # retry specific gRPC status codes, in ranges and separate single code. +``` ## Circuit Breakers From 7b1c27d64585448decaebc6bf75a9f843ff805bd Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Thu, 3 Oct 2024 13:44:53 +0100 Subject: [PATCH 2/8] Update daprdocs/content/en/operations/resiliency/policies.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Mark Fussell --- daprdocs/content/en/operations/resiliency/policies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/resiliency/policies.md b/daprdocs/content/en/operations/resiliency/policies.md index 61b3c3267..eef2a5b56 100644 --- a/daprdocs/content/en/operations/resiliency/policies.md +++ b/daprdocs/content/en/operations/resiliency/policies.md @@ -55,7 +55,7 @@ The following retry options are configurable: {{% alert title="httpStatusCodes and gRPCStatusCodes format" color="warning" %}} The field values should follow the format as specified in the field description or in the "Example 2" below. -Incorrectly formatted field value will cause the failure to load the policy and intentional failure to start `daprd`. +Incorrectly formatted field values cause the failure to load the policy and intentional failure to start `daprd`. {{% /alert %}} From 860ea174eef9f0a3c51fbccd5d8e95afcb55e4d1 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Thu, 3 Oct 2024 13:45:04 +0100 Subject: [PATCH 3/8] Update daprdocs/content/en/operations/resiliency/policies.md Signed-off-by: Mark Fussell --- daprdocs/content/en/operations/resiliency/policies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/resiliency/policies.md b/daprdocs/content/en/operations/resiliency/policies.md index eef2a5b56..74dd037ef 100644 --- a/daprdocs/content/en/operations/resiliency/policies.md +++ b/daprdocs/content/en/operations/resiliency/policies.md @@ -98,7 +98,7 @@ spec: maxRetries: 3 matches: httpStatusCodes: "429,500-599" # retry HTTP status codes in range, the rest will not be retried - gRPCStatusCodes: "1-4,8-11,13,14" # retry specific gRPC status codes, in ranges and separate single code. + gRPCStatusCodes: "1-4,8-11,13,14" # retry gRPC status codes in these ranges and separate single codes. ``` ## Circuit Breakers From c5dacaf3aa03703612c91d41a626a914abef3415 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Thu, 3 Oct 2024 13:45:13 +0100 Subject: [PATCH 4/8] Update daprdocs/content/en/operations/resiliency/policies.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Mark Fussell --- daprdocs/content/en/operations/resiliency/policies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/resiliency/policies.md b/daprdocs/content/en/operations/resiliency/policies.md index 74dd037ef..6dafda91e 100644 --- a/daprdocs/content/en/operations/resiliency/policies.md +++ b/daprdocs/content/en/operations/resiliency/policies.md @@ -50,7 +50,7 @@ The following retry options are configurable: | `maxInterval` | Determines the maximum interval between retries to which the `exponential` back-off policy can grow.
Additional retries always occur after a duration of `maxInterval`. Defaults to `60s`. Valid values are of the form `5s`, `1m`, `1m30s`, etc | | `maxRetries` | The maximum number of retries to attempt.
`-1` denotes an unlimited number of retries, while `0` means the request will not be retried (essentially behaving as if the retry policy were not set).
Defaults to `-1`. | | `matching.httpStatusCodes` | Optional: a comma-separated string of HTTP status codes or code ranges to retry. Status codes not listed are not retried.
Valid values: 100-599, [Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
Format: `` or range `-`
Example: "429,501-503"
Default, the empty string `""` or field not set, will retry on all HTTP errors. | -| `matching.gRPCStatusCodes` | Optional: a comma-separated string of gRPC status codes or code ranges to retry. Status codes not listed are not retried.
Valid values: 0-16, [Reference](https://grpc.io/docs/guides/status-codes/)
Format: `` or range `-`
Example: "1,501-503"
Default, the empty string `""` or field not set, will retry on all gRPC errors. | +| `matching.gRPCStatusCodes` | Optional: a comma-separated string of gRPC status codes or code ranges to retry. Status codes not listed are not retried.
Valid values: 0-16, [Reference](https://grpc.io/docs/guides/status-codes/)
Format: `` or range `-`
Example: "1,501-503"
Default: empty string `""` or field is not set. Retries on all gRPC errors. | {{% alert title="httpStatusCodes and gRPCStatusCodes format" color="warning" %}} From 35c3e33e5ad19eaaf88ba55cbe69061745a1853f Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Thu, 3 Oct 2024 13:45:21 +0100 Subject: [PATCH 5/8] Update daprdocs/content/en/operations/resiliency/policies.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Mark Fussell --- daprdocs/content/en/operations/resiliency/policies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/resiliency/policies.md b/daprdocs/content/en/operations/resiliency/policies.md index 6dafda91e..d49d8a335 100644 --- a/daprdocs/content/en/operations/resiliency/policies.md +++ b/daprdocs/content/en/operations/resiliency/policies.md @@ -49,7 +49,7 @@ The following retry options are configurable: | `duration` | Determines the time interval between retries. Only applies to the `constant` policy.
Valid values are of the form `200ms`, `15s`, `2m`, etc.
Defaults to `5s`.| | `maxInterval` | Determines the maximum interval between retries to which the `exponential` back-off policy can grow.
Additional retries always occur after a duration of `maxInterval`. Defaults to `60s`. Valid values are of the form `5s`, `1m`, `1m30s`, etc | | `maxRetries` | The maximum number of retries to attempt.
`-1` denotes an unlimited number of retries, while `0` means the request will not be retried (essentially behaving as if the retry policy were not set).
Defaults to `-1`. | -| `matching.httpStatusCodes` | Optional: a comma-separated string of HTTP status codes or code ranges to retry. Status codes not listed are not retried.
Valid values: 100-599, [Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
Format: `` or range `-`
Example: "429,501-503"
Default, the empty string `""` or field not set, will retry on all HTTP errors. | +| `matching.httpStatusCodes` | Optional: a comma-separated string of HTTP status codes or code ranges to retry. Status codes not listed are not retried.
Valid values: 100-599, [Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
Format: `` or range `-`
Example: "429,501-503"
Default: empty string `""` or field is not set. Retries on all HTTP errors. | | `matching.gRPCStatusCodes` | Optional: a comma-separated string of gRPC status codes or code ranges to retry. Status codes not listed are not retried.
Valid values: 0-16, [Reference](https://grpc.io/docs/guides/status-codes/)
Format: `` or range `-`
Example: "1,501-503"
Default: empty string `""` or field is not set. Retries on all gRPC errors. | From cd076a1d51041cdadd158914bd9a091f158fdbde Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Thu, 3 Oct 2024 13:45:29 +0100 Subject: [PATCH 6/8] Update daprdocs/content/en/operations/resiliency/policies.md Signed-off-by: Mark Fussell --- daprdocs/content/en/operations/resiliency/policies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/resiliency/policies.md b/daprdocs/content/en/operations/resiliency/policies.md index d49d8a335..f687f9504 100644 --- a/daprdocs/content/en/operations/resiliency/policies.md +++ b/daprdocs/content/en/operations/resiliency/policies.md @@ -97,7 +97,7 @@ spec: duration: 5s maxRetries: 3 matches: - httpStatusCodes: "429,500-599" # retry HTTP status codes in range, the rest will not be retried + httpStatusCodes: "429,500-599" # retry the HTTP status codes in this range. All others are not retried. gRPCStatusCodes: "1-4,8-11,13,14" # retry gRPC status codes in these ranges and separate single codes. ``` From 5d288d299cb7ad0ef72555426acc1d8f70159599 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Thu, 3 Oct 2024 13:47:17 +0100 Subject: [PATCH 7/8] Update daprdocs/content/en/operations/resiliency/policies.md Signed-off-by: Mark Fussell --- daprdocs/content/en/operations/resiliency/policies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/resiliency/policies.md b/daprdocs/content/en/operations/resiliency/policies.md index f687f9504..f863df5e4 100644 --- a/daprdocs/content/en/operations/resiliency/policies.md +++ b/daprdocs/content/en/operations/resiliency/policies.md @@ -55,7 +55,7 @@ The following retry options are configurable: {{% alert title="httpStatusCodes and gRPCStatusCodes format" color="warning" %}} The field values should follow the format as specified in the field description or in the "Example 2" below. -Incorrectly formatted field values cause the failure to load the policy and intentional failure to start `daprd`. +An incorrectly formatted value fails to load the policy and fails to start `daprd`. {{% /alert %}} From c561261af15d78e6aa348effc5ce77484f810aca Mon Sep 17 00:00:00 2001 From: Anton Troshin Date: Tue, 8 Oct 2024 00:48:16 -0500 Subject: [PATCH 8/8] Update startup behavior description according to decision made Signed-off-by: Anton Troshin --- daprdocs/content/en/operations/resiliency/policies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/resiliency/policies.md b/daprdocs/content/en/operations/resiliency/policies.md index f863df5e4..d394039d5 100644 --- a/daprdocs/content/en/operations/resiliency/policies.md +++ b/daprdocs/content/en/operations/resiliency/policies.md @@ -55,7 +55,7 @@ The following retry options are configurable: {{% alert title="httpStatusCodes and gRPCStatusCodes format" color="warning" %}} The field values should follow the format as specified in the field description or in the "Example 2" below. -An incorrectly formatted value fails to load the policy and fails to start `daprd`. +An incorrectly formatted value will produce an error log ("Could not read resiliency policy") and `daprd` startup sequence will proceed. {{% /alert %}}