Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry not working for Consul Config Client #266

Open
4 tasks done
sergey-morenets opened this issue Jun 20, 2021 · 1 comment
Open
4 tasks done

Retry not working for Consul Config Client #266

sergey-morenets opened this issue Jun 20, 2021 · 1 comment

Comments

@sergey-morenets
Copy link

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

Documentation on Retry states:

  1. The simplest form of retry is just to add the @retryable annotation to a type or method. The default behaviour of @retryable is to retry three times with an exponential delay of one second between each retry.
  2. Note also that the @retryable annotation can be applied on interfaces

I see that ConsulOperations.readValues method has @retryable annotation:

    @Get(uri = "/kv/{+key}?recurse=true{&dc}{&raw}{&seperator}", single = true)
    @Retryable(
        attempts = AbstractConsulClient.EXPR_CONSUL_CONFIG_RETRY_COUNT,
        delay = AbstractConsulClient.EXPR_CONSUL_CONFIG_RETRY_DELAY
    )
    Publisher<List<KeyValue>> readValues(
        String key,
        @Nullable @QueryValue("dc") String datacenter,
        @Nullable Boolean raw,
        @Nullable String seperator);

This method is used in ConsulConfigurationClient to fetch configuration values from Consul so I assume that retry pattern should be used here (3 attempts by default). However if HTTP client error happened (for example, "Connection refused") retry is not invoked (and DefaultRetryInterceptor is not called). It doesn't happen either if I add explicit retry configuration in bootstrap.yml:

consul:
  client:
    config:
      retry-count: 4
      retry-delay: 10s

Expected Behaviour

If an operation to fetch configuration values from Consul failed it should be retried

Actual Behaviour

The operation to fetch configuration values from Consul is executed only once in any case.

Environment Information

  • Operating System: Windows 10
  • Micronaut Version: 2.5.0
  • JDK Version: 1.16.01
@sergey-morenets
Copy link
Author

Any updates on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant