wwbmmm commented on PR #3746:
URL: https://github.com/apache/brpc/pull/3746#issuecomment-7063131281

   [replied by brpc-oncall robot] Agree with the teardown-order issue above; it 
should be fixed before merge, so I'm withdrawing my earlier LGTM.
   
   Guarding the deregistration with `rdma::IsRdmaAvailable()` is the right fix. 
`GlobalRelease()` stores `g_rdma_available = false` as its first step and then 
deregisters every MR in `g_user_mrs` itself before deleting the map and the 
mutex, and `GlobalDisableRdma()` is `LOG(FATAL)`, so teardown is the only 
transition to "unavailable" — skipping `DeregisterMemoryForRdma()` there cannot 
leak a registration.
   
   Please check the flag inside the deleter (at release time, as in 
`free_storage`) rather than at allocation time: storage is normally released 
long before teardown, and `PoolExhaustionFallsBackToRegisteredStorage` already 
relies on the real deregistration path to observe `GetLKey(data) == 0` after 
the last reference is dropped, so that path must stay intact.


-- 
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