You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/12/02 17:22:45 UTC

[GitHub] [geode-native] gaussianrecurrence edited a comment on pull request #697: Feature/asio

gaussianrecurrence edited a comment on pull request #697:
URL: https://github.com/apache/geode-native/pull/697#issuecomment-737375684


   > @albertogpz Despite it's terrible name, `doIfDestroyNotPending` ends a race condition where code tries to access the cache after it was destroyed. It's a shame we apparently need to set max connections which is only available from the distributed system when we close connections. This could cause a segfault during client shutdown.
   
   Problem is that using doIfDestroyNotPending has undefined behaviour, as you are accessing the CacheImpl status equally. If it happens that the cache is removed and the mem page on which the cache was gets overwritten, doIfDestroyNotPending could try to execute the lambda.
   
   The issue here is that whenever ThinClientPoolDM::destroy is called, m_endpoints is not cleared
   By the time ThinClientPoolDM::~ThinClientPoolDM is called, m_endpoints is to be destroyed, decrementing the reference counter to each of the container items.
   If it happens that the container is holding an object which this was its latest reference, TcrEndpoint::TcrEndpoint will be called leading to undefined behaviour.
   
   The solution here is to make sure that before a pool destructor is called, all the references to the endpoints are cleared out.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org