Skip to content

Retry filter results in infinite loop for 500 error from backend #339

Closed

Description

@arkin

Using the 2.0.0.RC2 sample app, I added the Retry filter with default settings.
Then I issued a GET request to localhost:8080/status/500 and the gateway started a seemingly infinite loop making requests.

Below is the full application.yml, but the main changes are changes to point it to httpbin.org and to add the retry filter.

test:
  hostport: httpbin.org:80
#  hostport: localhost:5000
  uri: http://${test.hostport}
#  uri: lb://httpbin


spring:
  jmx:
    enabled: false
  cloud:
    gateway:
      default-filters:
#      - PrefixPath=/httpbin
      - AddResponseHeader=X-Response-Default-Foo, Default-Bar

      routes:
      # =====================================
      # to run server
      # $ wscat --listen 9000
      # to run client
      # $ wscat --connect ws://localhost:8080/echo
      - id: websocket_test
        uri: ws://localhost:9000
        order: 9000
        predicates:
        - Path=/echo
      # =====================================
      - id: default_path_to_httpbin
        uri: ${test.uri}
        order: 10000
        predicates:
        - Path=/**
        filters:
        - name: Retry


logging:
  level:
    org.springframework.cloud.gateway: TRACE
    org.springframework.http.server.reactive: DEBUG
    org.springframework.web.reactive: DEBUG
    reactor.ipc.netty: DEBUG

management.endpoints.web.exposure.include: '*'

Activity

  1. changed the title [-]Retry filter results in infinite loop[/-] [+]Retry filter results in infinite loop for 500 error from backend[/+] on Jun 8, 2018
  2. arkin commented on Jun 8, 2018

    @arkin
    Author

    When I configure for IOException, the retry works fine. This issue seems to be limited to retrying http status code based retries.

  3. arkin commented on Jun 8, 2018

    @arkin
    Author

    The RetryGatewayFilterFactory does not allow me to leave the series and status configurations empty. I was trying to configure the retry filter such that it retries only in case of IOException s and not based on status codes. I will create a separate issue to request that enhancement.

  4. added this to the 2.0.0.RELEASE milestone on Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址