-
Notifications
You must be signed in to change notification settings - Fork 758
[Cherry-Pick][BugFix] RDMA: retry ibv_post_send from bad_wr and drain CQ on failure(#8091) #8093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Sunny-bot1
merged 1 commit into
PaddlePaddle:release/2.6
from
EmmonsCurse:cherry-pick/8091/release/2.6
Jul 2, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Bug 这里在重试前把
ctx->cq上的所有 CQE 都直接丢弃了,但这个 CQ 是共享的。create_qp()同时把send_cq/recv_cq设为ctx->cq,write_cache的 pybind 入口会释放 GIL,而且write_cache()只在get_conn()时短暂加锁,后续post_send_with_retry()、execute_read_verification()、poll_cq_with_timeout()都可能在同一个RdmaContext上消费这个 CQ。生产高压下如果另一个线程正在等待自己的 signaled write/read completion,这个 drain 可能先把它的 CQE 吞掉,导致对方 30s timeout,或者把非成功 WC 状态静默丢掉。建议修复方式:将同一
RdmaContext上的 post/poll/drain 序列纳入连接级互斥,或改成每个并发发送方使用独立 QP/CQ/完成分发器并按wr_id归属处理 completion;这个 retry helper 不应裸 drain 共享 CQ。