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

Nacos Client brushing log #657

Closed
caojianqiang1984 opened this issue May 21, 2019 · 3 comments
Closed

Nacos Client brushing log #657

caojianqiang1984 opened this issue May 21, 2019 · 3 comments
Labels
area/nacos spring cloud alibaba nacos kind/question

Comments

@caojianqiang1984
Copy link

caojianqiang1984 commented May 21, 2019

Which Component
org.springframework.cloud:spring-cloud-starter-alibaba-nacos-discovery:0.9.0.RELEASE

Describe the bug
只要请求不存在的服务,就会不断刷日志

To Reproduce
Steps to reproduce the behavior:

  1. 注入服务发现客户端
    @Autowired
    private DiscoveryClient discoveryClient;
  2. 偿试获取一个不存在的服务
    discoveryClient.getInstances("service-i");

当服务"service-i"不存在或者下线时,客户端就会不断打印如下日志
11:03:47.307 ERROR [] HostReactor.updateServiceNow:278 [NA] failed to update serviceName: DEFAULT_GROUP@@DBB-Applyjava.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance/list after all servers([service.dev.furong.ink:8848]) tried: failed to req API:http://service.dev.furong.ink:8848/nacos/v1/ns/instance/list. code:404 msg: service not found: DEFAULT_GROUP@@service-i
at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:380)
at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:304)
at com.alibaba.nacos.client.naming.net.NamingProxy.queryList(NamingProxy.java:217)
at com.alibaba.nacos.client.naming.core.HostReactor.updateServiceNow(HostReactor.java:273)
at com.alibaba.nacos.client.naming.core.HostReactor$UpdateTask.run(HostReactor.java:318)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

Additional context
Add any other context about the problem here.
版本号:
Java11 + spring cloud Greenwich.RELEASE + org.springframework.cloud:spring-cloud-starter-alibaba-nacos-discovery:0.9.0.RELEASE

@fangjian0423
Copy link
Contributor

Hi. @caojianqiang1984

This is a normal phenomenon. It will print code:404 msg: service not found:... when service not found in nacos.

I think we could create a issue in nacos to discuss whether throw 404 exception when service not found.

Nacos issue: https://github.com/alibaba/nacos/issues

@fangjian0423 fangjian0423 added area/nacos spring cloud alibaba nacos kind/question labels May 21, 2019
@fangjian0423 fangjian0423 changed the title 客户端刷日志 Nacos Client brushing log May 21, 2019
@caojianqiang1984
Copy link
Author

caojianqiang1984 commented May 22, 2019

@fangjian0423 打印日志很正常,但它是刷日志,每一秒刷一次,刷个不停,直到找到这个服务为止。而这个服务是不存在的,日志会每隔一秒打印一次不停的刷

@fangjian0423
Copy link
Contributor

refer alibaba/nacos#1252 and #661.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nacos spring cloud alibaba nacos kind/question
Projects
None yet
Development

No branches or pull requests

2 participants