Skip connUpdateState for async free clients for RDMA - #4474
Conversation
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The |
There was a problem hiding this comment.
The code change follows the existing C_ERR contract and avoids touching a dying client. The PR's test-rdma check is currently failing even though the base commit's two RDMA runs passed; I posted the failing job separately because it has no diff line to anchor to.
This seems a flaky test, not related with my fix. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## forkless #4474 +/- ##
============================================
- Coverage 79.82% 79.42% -0.41%
============================================
Files 175 175
Lines 94843 93223 -1620
============================================
- Hits 75712 74044 -1668
- Misses 19131 19179 +48
🚀 New features to boost your workflow:
|
|
The control-flow change looks correct. C_ERR means the client must no longer be touched: it either has already been freed during command processing or has been scheduled for asynchronous free via close_asap. Skipping the remainder of the iteration prevents RDMA's connUpdateState() from synchronously re-entering handlers on such a client, while the C_OK path remains unchanged. The failing test-rdma job appears unrelated. It fails during the phase-1 RDMA CM smoke test, before the IO-thread benchmark, with RDMA_CM_EVENT_REJECTED and server-side accept failures. This hunk is only reachable after an IO-thread read completion. Please rerun that job before merging. No blocking findings from me. |
Summary
In forkless
processPendingCommandAndInputBuffer, we add the extra check:In
handleReadJobs(), whenprocessPendingCommandAndInputBufferreturns C_ERR, the client is dying but may not yet be freed. The subsequentconnUpdateStateis still called, which for RDMA synchronously invokes the read handler and could cause use-after-free. Fix by skipping the rest of the loop iteration on C_ERR.