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

   ### What problem does this PR solve?
   
   Issue Number: resolve
   
   Problem Summary:
   
   `ObjectPool::Block::nitem` is written by the owning `LocalPool` while
   `describe_objects()` reads it concurrently. As a plain `size_t`, this is a 
C++
   data race and may expose a partially constructed object count.
   
   ### What is changed and the side effects?
   
   Changed:
   
   - Make `ObjectPool::Block::nitem` atomic.
   - Publish completed object construction with a release store.
   - Read the item count with acquire ordering in statistics and ASan cleanup.
   - Add a concurrent `get_object()` / `describe_objects()` regression test.
   
   Side effects:
   
   - Performance effects: One atomic load/store when allocating a new object 
from
     a block. The pool's free-list fast path is unchanged.
   
   - Breaking backward compatibility: None.
   
   ---
   
   ### 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