stream模式,为啥receiver卡死的情况下,导致sender也卡死了? 一直卡在BRPC_HANDLE_EOVERCROWDED这个宏里
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- networking
Research direction
Start with brpc::Stream::WriteToHostSocket, Stream::CutMessageIntoFileDescriptor, and the BRPC_HANDLE_EOVERCROWDED and BRPC_HANDLE_EOVERCROWDED_N definitions and call sites. Reproduce the stream write with a blocked receiver, compare the two macro behaviors, and determine whether the sender's prolonged sleep is expected or indicates a bug; document the conclusion with a focused regression case if needed.
Written by the indexing model from the issue text.
Description
堆栈(Stack)
Stack:
#0 0x00007f7410dc6a41 clock_nanosleep@@GLIBC_2.17
#1 0x00007f7410dcbf67 __nanosleep
#2 0x00007f7410df7a49 usleep
#3 0x000000000121c897 bthread_usleep
#4 0x00000000013412e1 brpc::Stream::WriteToHostSocket(butil::IOBuf*)
#5 0x0000000001343b3a brpc::Stream::CutMessageIntoFileDescriptor(int, butil::IOBuf**, unsigned long)
#6 0x0000000001331712 brpc::Socket::StartWrite(brpc::Socket::WriteRequest*, brpc::Socket::WriteOptions const&)
#7 0x0000000001331b92 brpc::Socket::Write(butil::IOBuf*, brpc::Socket::WriteOptions const*)
#8 0x0000000001341464 brpc::Stream::AppendIfNotFull(butil::IOBuf const&)
#9 0x0000000001342ce4 brpc::StreamWrite(unsigned long, butil::IOBuf const&)
#10 0x0000000000bc87aa proxima::centaur::kafka_proxy::KafkaProxyService::send_task_job()
#11 0x00007f74110e8b74 execute_native_thread_routine
#12 0x00007f74123b73f9 start_thread
#13 0x00007f7410dffb13 __clone
宏定义代码
// Sleep a while when `write_expr' returns negative with errno=EOVERCROWDED
// Implemented as a macro rather than a field of Socket.WriteOptions because
// the macro works for other functions besides Socket.Write as well.
#define BRPC_HANDLE_EOVERCROWDED(write_expr) \
({ \
int64_t __ret_code__; \
int sleep_time = 250; \
while (true) { \
__ret_code__ = (write_expr); \
if (__ret_code__ >= 0 || errno != ::brpc::EOVERCROWDED) { \
break; \
} \
sleep_time *= 2; \
if (sleep_time > 2000) { sleep_time = 2000; } \
::bthread_usleep(sleep_time); \
} \
__ret_code__; \
})
我看还有个BRPC_HANDLE_EOVERCROWDED_N, 想请教下当时没有用_N,是基于什么考虑呢?
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.2k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 72
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/brpc
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
endpoint2hostname() prints a byte-swapped port for IPv6 endpointsPossibly taken @0z5a claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 2 days
-
perf(butil): ARM64 (aarch64) performance and modernisation improvements across atomics, CRC32C, spin-wait hints, and fast timersPossibly taken @jimmystewpot claimed this 2 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 12/100
Maintainers usually reply within 2 days
-
file:// naming service takes a comment after the address as the tagPossibly taken @0z5a claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 2 days
Similar issues
-
agent:Windows bug in progress pri:medium sev:low testing windows
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
protocolbuffers/protobuf#31768 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
godotengine/godot#125651 ·
Maintainers usually reply within 1 day
-
Android: with view recycling on, a recycled View keeps its nextFocusLeftPossibly taken A pull request linked to this issue is open or already merged. OpenNeeds: Triage :mag: Platform: Android
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
react/react-native#60167 ·
Maintainers usually reply within 2 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 63/100