possible resource leak of ibv_comp_channel in rdma
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 69
Description
我在阅读rdma部分代码时,在 `GlobalRdmaInitializeOrDieImpl` 函数中看到一行比较奇怪的代码。它在全局初始化的过程中调用了 `IbvCreateCompChannel` 来创建应该由 `RdmaEndpoint` 管理的资源,并且没有对创建的 `ibv_comp_channel` 进行销毁。
请问这行代码符合预期吗?如果符合预期,请问这一行的作用是什么呢?
代码位置 https://github.com/apache/brpc/blob/d7eca3991f0f38121a4e40831e548d8802fa6b1a/src/brpc/rdma/rdma_helper.cpp#L492
Contributor guide
Research direction
Start in src/brpc/rdma/rdma_helper.cpp at GlobalRdmaInitializeOrDieImpl and the IbvCreateCompChannel call linked in the issue. Trace how the resulting ibv_comp_channel is owned and whether RdmaEndpoint provides its lifecycle management. Done means establishing whether the allocation is intentional and, if not, identifying the required cleanup path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100