apache / apache/brpc

Client端latency_us远超过timeout

Open
#2,485 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**Describe the bug (描述bug)**
查询持续请求存储节点,返回超时报错:
![image](https://github.com/apache/brpc/assets/50567662/57af856d-de21-4260-9ed5-954d4261d619)
设置的timeout为115ms,但是统计的timeCostUs_(即latency_us)已经达到5s;
后面持续返回timeout,且latency_us越来越大,甚至达到20s

对于client端,latency_us包括哪些时间?有办法统计到内部各个阶段的时间吗(例如在接收队列排队时间)?

**To Reproduce (复现方法)**
只在某个机器上能复现出来,换了台机器就不会出现

**Expected behavior (期望行为)**
应该超时时立即返回?
**Versions (各种版本)**
OS:
Compiler:gcc (GCC) 9.2.1 20200522 (Alibaba 9.2.1-3 2.17)
brpc:
protobuf:

**Additional context/screenshots (更多上下文/截图)**

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the client records timeCostUs_ (latency_us) relative to the 115 ms timeout and follow the request path through any queueing stages. Reproduce on the affected machine, collect the missing brpc and protobuf versions, and compare the observed timeout return with the latency measurement. Done means the latency components and the reason latency_us exceeds timeout are identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design, networking
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.