question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"retry_policy" supports only one "retry_on" condition

See original GitHub issue

Description Envoy allows to provide more than one “retry_on” condition in “retry_policy” i.e.

"retry_policy": {
"retry_on": "connect-failure,retriable-status-codes,refused-stream",
"num_retries": 2
}

However, using

"retry_on": "connect-failure,retriable-status-codes,refused-stream"

in Ambassador’s mapping config results in error in Ambassador retry policy configuration.

Steps to reproduce the behavior:

  1. Create mapping with specified “retry_policy” with more than one “retry_on” condition i.e.
      apiVersion: ambassador/v1
      kind:  Mapping
      name: {{ include "xxx.yyy.zzz .}}_mapping
      prefix: /{{ include "ccc.vvv.bbb" .}}
      service: https://{{ include "ccc.vvv.bbb" .}}.{{ .Release.Namespace }}.svc.cluster.local.:80
      tls: upstream
      retry_policy:
        retry_on: "connect-failure,5xx,retriable-4xx,"
        num_retries: 2
  1. Apply mapping from above.

  2. See error in Ambassador Diagnostic Overview -> ir.retrypolicy: Invalid retry policy specified: <IRRetryPolicy ir.retrypolicy>

Expected behavior Ambassador’s retry policy should be able to handle multiple values in “retry_on” to reflect Envoy retry capabilities.

Affected version Affected version -> Ambassador: 0.61.1

Additional context Method that validates “retry_on” value:

ambassador/ambassador/ir/irretrypolicy.py

 def validate_retry_policy(self) -> bool:
        retry_on = self.get('retry_on', None)

        is_valid = False
        if retry_on in [ '5xx', 'gateway-error', 'connect-failure', 'retriable-4xx', 'refused-stream', 'retriable-status-codes' ]:
            return True

        return is_valid

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kflynncommented, Jun 12, 2019

Yeah, let me see how to get this in…

0reactions
justinfiorecommented, Sep 9, 2022

Can we reopen this? We would also like to be able to specify multiple retry_on values. In particular, is there any way to retry on just 502 and 503 and connect-failure and refused-stream? i.e. I don’t want to retry on 504’s or 500’s

Read more comments on GitHub >

github_iconTop Results From Across the Web

"retry_policy" supports only one "retry_on" condition #1570
Steps to reproduce the behavior: Create mapping with specified "retry_policy" with more than one "retry_on" condition i.e. ... Apply mapping from ...
Read more >
RetryPolicy (AWS SDK for Java - 1.12.367)
Parameters: retryCondition - Retry condition on whether a specific request and exception should be retried. If null value is specified, the SDK' default ......
Read more >
net.jodah.failsafe.RetryPolicy java code examples
Copy constructor. withMaxRetries. Sets the max number of retries to perform when an execution attempt fails. -1 indicates no limit. Th. withBackoff ·...
Read more >
Retry guidance for Azure services
The Azure Cosmos DB SDKs automatically retry on certain error conditions, and user applications are encouraged to have their own retry ...
Read more >
failsafe-lib/failsafe
@sahihaimanish_twitter Failsafe will only perform one retry at a time for some ... On 1.1.0 I used to use RetryPolicy with retryOn with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found