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

WARN Ignoring onDemand update due to rate limiter #1537

Open
Selaron opened this issue Feb 29, 2024 · 0 comments
Open

WARN Ignoring onDemand update due to rate limiter #1537

Selaron opened this issue Feb 29, 2024 · 0 comments

Comments

@Selaron
Copy link

Selaron commented Feb 29, 2024

We get a warning log message on start up WARN Ignoring onDemand update due to rate limiter.

The onDemandUpdate is called three times:

Breakpoint reached
	at com.netflix.discovery.InstanceInfoReplicator.onDemandUpdate(InstanceInfoReplicator.java:88)
	at com.netflix.discovery.DiscoveryClient.registerHealthCheck(DiscoveryClient.java:638)
	at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.eurekaClient(EurekaClientAutoConfiguration.java:322)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140)

Breakpoint reached
	at com.netflix.discovery.InstanceInfoReplicator.onDemandUpdate(InstanceInfoReplicator.java:88)
	at com.netflix.discovery.DiscoveryClient$3.notify(DiscoveryClient.java:1297)
	at com.netflix.appinfo.ApplicationInfoManager.setInstanceStatus(ApplicationInfoManager.java:176)
	at com.netflix.discovery.DiscoveryClient.refreshInstanceInfo(DiscoveryClient.java:1391)
	at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:117)
	at com.netflix.discovery.InstanceInfoReplicator$1.run(InstanceInfoReplicator.java:101)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
	at java.util.concurrent.FutureTask.run(FutureTask.java:-1)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(Thread.java:840)

Breakpoint reached
	at com.netflix.discovery.InstanceInfoReplicator.onDemandUpdate(InstanceInfoReplicator.java:88)
	at com.netflix.discovery.DiscoveryClient.registerHealthCheck(DiscoveryClient.java:638)
	at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry.lambda$register$0(EurekaServiceRegistry.java:48)
	at org.springframework.cloud.netflix.eureka.serviceregistry.EurekaServiceRegistry$$Lambda$2070/0x00007f30ecd712f0.accept(Unknown Source:-1)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory$DependencyObjectProvider.ifAvailable(DefaultListableBeanFactory.java:2126)

Maybe this could be fixed if the registerHealthCheck method would recognize second invocation with the same healthCheckerHandler:

public void registerHealthCheck(HealthCheckHandler healthCheckHandler) {
    if (instanceInfo == null) {
        logger.error("Cannot register a healthcheck handler when instance info is null!");
    }
    if (healthCheckHandler != null) {
        if (this.healthCheckHandlerRef.getAndSet(healthCheckHandler) != healthCheckHandler) {
            // schedule an onDemand update of the instanceInfo when a new healthcheck handler is registered
            if (instanceInfoReplicator != null) {
                instanceInfoReplicator.onDemandUpdate();
            }
        } else {
            logger.debug("Same healthCheckHandler registered twice.");
        }
    }
}
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