apache / apache/brpc

bthread定时器等待了12秒都没得到执行,程序生成core的过程中又恢复了,想问下要如何定位这种问题?

Open
#2,455 2 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)**

bthread定时器等待了12秒都没得到执行,触发了程序检查bthread卡住的assert,而在程序生成core的过程中又恢复了。

**To Reproduce (复现方法)**
在正常业务中,创建pthread线程和bthread定时器,在pthread线程中定时检查定时器的更新时间。超过一段时间未更新,则assert

**Expected behavior (期望行为)**
程序不会触发bthread卡住的assert
**Versions (各种版本)**
OS: centosx
Compiler: gcc
brpc:
protobuf:

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

想问下,一个是如何定位这种bthread卡住一段时间的这种问题?如何查看当时的运行截面?之前遇到过使用pstack去dump查看,结果
bthread似乎又被恢复了。我这个也类似这种现象,bthread不知道因为什么原因卡住了,然后又恢复了。

Contributor guide

Open the contributing guide

Research direction

Start with the reported bthread timer and the pthread-based watchdog that triggers the assert, then reproduce the delay under the stated CentOS and GCC environment. Compare what pstack shows during the delay with the behavior while the core is being generated. Done means identifying why the bthread timer pauses and documenting a reliable way to capture the runtime state.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.