apache / apache/incubator-seata

并发:ERROR:c.a.nacos.client.config.impl.Limiter,c.a.n.client.config.impl.ClientWorker

Open
#2,023 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

jar version
![image](https://user-images.githubusercontent.com/17922001/70679288-a3321d80-1ccf-11ea-8025-d70e73d1ac3c.png)
![image](https://user-images.githubusercontent.com/17922001/70682783-eba30880-1cda-11ea-8077-6448afe2a445.png)

AbstractRpcRemotingClient
会定时根据(my-seata-tx-group)检测获取可以用的服务
![image](https://user-images.githubusercontent.com/17922001/70679305-acbb8580-1ccf-11ea-8517-75d206cd5a38.png)
![image](https://user-images.githubusercontent.com/17922001/70679311-b1803980-1ccf-11ea-804b-007279ce15fb.png)
这里是5秒执行一次
根据dataId获取value

![image](https://user-images.githubusercontent.com/17922001/70679325-b93fde00-1ccf-11ea-84df-ee9e7f17edaf.png)
省略中间部分,最终会使用ServerHttpAgent.httpGet
![image](https://user-images.githubusercontent.com/17922001/70679340-c066ec00-1ccf-11ea-8532-dc56f578dc6f.png)
然后问题是Limiter.isLimit进行QPS了;看代码意思是:5/1000毫秒,也就是5/1秒;
![image](https://user-images.githubusercontent.com/17922001/70679350-c8269080-1ccf-11ea-87bb-8a07d70612e7.png)
![image](https://user-images.githubusercontent.com/17922001/70679356-cd83db00-1ccf-11ea-95d0-e79455e94988.png)
如果qps了,会返回-503,然后打印出错误日志;最后会取本地缓存的值
![image](https://user-images.githubusercontent.com/17922001/70679358-cfe63500-1ccf-11ea-8e52-8bf213cb8a19.png)

### **疑惑不解的地方:**
正常情况下是没有问题的,
当我并发测试时就会不停的报错误日志,虽然结果不会有影响;但是不太明白会seata的naocs客户端QPS的原因;
前面的5秒定时任务,也应该不会超过这个限制?
每次请求都会实时去nacos中心拉取一次最新的配置吗?(不太好调试去验证这个问题,因为有定时任务不断的妨碍我DEBUG)
![image](https://user-images.githubusercontent.com/17922001/70679368-d96f9d00-1ccf-11ea-808d-d207a4720397.png)
![image](https://user-images.githubusercontent.com/17922001/70679372-dc6a8d80-1ccf-11ea-8686-83de38212565.png)

Contributor guide

Open the contributing guide

Research direction

Start by tracing the five-second service check from AbstractRpcRemotingClient through the Nacos ClientWorker and ServerHttpAgent.httpGet to Limiter.isLimit. Reproduce the concurrent requests, determine whether each request fetches configuration or uses a cache, and confirm whether the observed -503 logs are expected; document the cause and required behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.