kuma icon indicating copy to clipboard operation
kuma copied to clipboard

RateLimitedBackOff set to 8 seconds retries after ~11 seconds

Open slonka opened this issue 3 years ago • 13 comments

What happened?

We're setting "x-retry-after" to 8 seconds but the delay is longer.

image

Also, request time was quite small so not sure what happened there: image

slonka avatar Jan 16 '23 11:01 slonka

ProxyTemplate to add response header:

apiVersion: kuma.io/v1alpha1
kind: ProxyTemplate
mesh: default
metadata:
  name: custom-template-1
spec:
  selectors:
    - match:
        kuma.io/service: backend_kuma-demo_svc_3001
  conf:
    imports:
      - default-proxy
    modifications:
      - virtualHost:
          operation: remove
          match:
            name: "backend_kuma-demo_svc_3001"
      - virtualHost:
          operation: add
          match:
            routeConfigurationName: "inbound:backend_kuma-demo_svc_3001"
          value: |
            name: "backend_kuma-demo_svc_3001"
            domains:
            - "*"
            routes:
            - match:
                prefix: /
              route:
                cluster: "localhost:3001"
                timeout: "0s"
              responseHeadersToAdd:
                - header:
                    key: "x-retry-after-header"
                    value: "8"

lobkovilya avatar Jan 16 '23 11:01 lobkovilya

Same thing happens on k3d locally (1st retry triggered after ~11 seconds):

image image

Fault injection:

apiVersion: kuma.io/v1alpha1
kind: FaultInjection
mesh: default
metadata:
  name: fi1
spec:
  sources:
    - match:
        kuma.io/service: frontend_kuma-demo_svc_8080
        kuma.io/protocol: http
  destinations:
    - match:
        kuma.io/protocol: http
        kuma.io/service: backend_kuma-demo_svc_3001
  conf:        
    abort:
      httpStatus: 500
      percentage: 80

MeshRetry:

apiVersion: kuma.io/v1alpha1
kind: MeshRetry
metadata:
  name: mesh-retry
  namespace: kuma-system
  labels:
    kuma.io/mesh: default
spec:
  targetRef:
    kind: Mesh
  to:
    - targetRef:
        kind: Mesh
      default:
        http: 
          numRetries: 5
          retryOn:
            - 5xx
          rateLimitedBackOff:
            resetHeaders:
              - name: "x-retry-after-header"
                format: "Seconds"

MeshTrace:

apiVersion: kuma.io/v1alpha1
kind: MeshTrace
metadata:
  name: default
  namespace: kuma-system
  labels:
    kuma.io/mesh: default # optional, defaults to `default` if unset
spec:
  targetRef:
    kind: Mesh
  default:
    backends:
      - zipkin:
          url: http://jaeger-collector.mesh-observability:9411/api/v2/spans

Default request timeout (timeout-all-default) changed to:

      requestTimeout: 120s

slonka avatar Jan 23 '23 08:01 slonka

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] avatar Apr 24 '23 07:04 github-actions[bot]

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] avatar Aug 01 '23 07:08 github-actions[bot]

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] avatar Nov 07 '23 07:11 github-actions[bot]

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] avatar Feb 08 '24 07:02 github-actions[bot]

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] avatar May 10 '24 07:05 github-actions[bot]

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] avatar Aug 19 '24 07:08 github-actions[bot]