[ https://issues.apache.org/jira/browse/GEODE-8063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17101155#comment-17101155 ]
ASF GitHub Bot commented on GEODE-8063: --------------------------------------- pdxcodemonkey commented on a change in pull request #597: URL: https://github.com/apache/geode-native/pull/597#discussion_r421069121 ########## File path: cppcache/src/CacheImpl.cpp ########## @@ -640,13 +640,16 @@ void CacheImpl::readyForEvents() { } } -bool CacheImpl::isPoolInMultiuserMode(std::shared_ptr<Region> regionPtr) { - const auto& poolName = regionPtr->getAttributes().getPoolName(); +bool CacheImpl::isPoolInMultiuserMode(std::shared_ptr<Region> region) { + const auto& poolName = region->getAttributes().getPoolName(); if (!poolName.empty()) { - auto poolPtr = regionPtr->getCache().getPoolManager().find(poolName); - if (poolPtr != nullptr && !poolPtr->isDestroyed()) { - return poolPtr->getMultiuserAuthentication(); + auto pool = static_cast<RegionInternal&>(*region) + .getCacheImpl() + ->getPoolManager() + .find(poolName); + if (pool && !pool->isDestroyed()) { + return pool->getMultiuserAuthentication(); Review comment: Before I approve and merge this, can you explain why a method on CacheImpl is checking whether its pool is in multi-user mode by getting hold of _another_ CacheImpl pointer and extracting the pool from there? Why can't CacheImpl call getPoolManager() on itself? This code is super weird without any context... ---------------------------------------------------------------- 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: us...@infra.apache.org > Access violation during Cache destrucition caused by ClientMetadataService > -------------------------------------------------------------------------- > > Key: GEODE-8063 > URL: https://issues.apache.org/jira/browse/GEODE-8063 > Project: Geode > Issue Type: Bug > Components: native client > Reporter: Jacob Barrett > Assignee: Jacob Barrett > Priority: Major > > During the destruction of {{Cache}} the pointer to {{CacheImpl}} is invalid. > Calls from {{ClientMetadataService}} attempt to access {{Pool}} instances > through the {{Cache}} instance rather than {{CacheImpl}} resulting in access > violation. This issue is timing dependent and isn't always reproducible. -- This message was sent by Atlassian Jira (v8.3.4#803005)