apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.41k stars 3.96k forks source link

fix h2 rpc_dump memory leak bug #2661

Closed GreateCode closed 3 months ago

GreateCode commented 3 months ago

What problem does this PR solve?

Issue Number:

Problem Summary: h2 rpc_dump时 内存泄漏

具体是http和h2都走ProcessHttpRequest方法,在处理rpc_dump时,先AskToBeSampled创建堆对象再判is_http2,若是http2无释放堆对象逻辑。

发压cmd:rpc_press -protocol=h2 xxxx

What is changed and the side effects?

Changed: h2 req不做AskToBeSampled

修复前: image image image image

brpc_h2_rpc_dump_mem_leak_bug.pdf

修复后: image image image

brpc_h2_rpc_dump_mem_leak_fixed.pdf

Side effects:


Check List:

GreateCode commented 3 months ago

@chenBright

GreateCode commented 3 months ago

@wwbmmm 合下?

yanglimingcn commented 3 months ago

LGTM