BGQ99 opened a new pull request, #3626:
URL: https://github.com/apache/brpc/pull/3626

   ### What problem does this PR solve?
   
   Issue Number: Related to #3428
   
   Problem Summary:
   
   URMA send completion handling publishes the reclaimed SQ credit before 
clearing the corresponding IOBuf. A concurrent writer can observe the available 
credit and reuse the ring slot while the completion handler is still clearing 
it, potentially causing concurrent IOBuf modification and a crash during buffer 
release.
   
   ### What is changed and the side effects?
   
   Changed:
   - Clear the completed send buffer and advance the completion cursor before 
publishing the SQ credit, following the reclamation order used by the RDMA 
endpoint.
   - Move the existing memory barrier before the credit update.
   - Check window capacity before reclamation so an invalid completion cannot 
clear a buffer or advance the cursor.
   - Add regression tests for reclamation order, cursor wraparound, and 
rejection of a completion when the SQ window is already full.
   
   Validation:
   - CI passed in the LinQuickDev/brpc repository.
   - Full CMake build with `WITH_URMA=ON` and `URMA_USE_MOCK=ON` passed.
   - All 17 URMA unit tests passed, including the 3 new tests.
   - The reclamation-order test fails as expected with the original upstream 
implementation.
   - `git diff --check` passed.
   - Real URMA hardware validation of this upstream-based revision and ASAN 
were not run locally.
   
   Side effects:
   - Performance effects: adds a capacity check before reclamation. No 
performance improvement is claimed.
   - Breaking backward compatibility: none intended. No public API or wire 
protocol changes. Receive processing and ACK-only completions are unchanged.
   
   ---
   ### Check List:
   - Please make sure your changes are compilable.
   - When providing us with a new feature, it is best to add related tests.
   - Please follow [Contributor Covenant Code of 
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to