[ https://issues.apache.org/jira/browse/GEODE-8543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17277913#comment-17277913 ]
ASF GitHub Bot commented on GEODE-8543: --------------------------------------- jvarenina commented on a change in pull request #705: URL: https://github.com/apache/geode-native/pull/705#discussion_r569326130 ########## File path: cppcache/src/TcrEndpoint.cpp ########## @@ -1155,6 +1157,10 @@ void TcrEndpoint::setConnectionStatus(bool status) { m_isActiveEndpoint = false; LOGFINE("Disconnected from endpoint %s", m_name.c_str()); triggerRedundancyThread(); + // Test hook + if (TcrEndpoint::TEST_DISCONNECTIONS) { + TcrEndpoint::listOfDisconnectedServers.push_back(m_name.c_str()); Review comment: Thanks for comments! Would it be acceptable to use existing counter and method `numberOfTimesFailed()` from `TcrEndpoint` to check for disconnections? ``` int32_t numberOfTimesFailed() { return m_numberOfTimesFailed; } ... void TcrEndpoint::setConnectionStatus(bool status) { std::lock_guard<decltype(m_connectionLock)> guard(m_connectionLock); if (m_connected != status) { bool connected = m_connected; m_connected = status; if (connected) { m_numberOfTimesFailed += 1; m_isAuthenticated = false; // disconnected LOGFINE("Disconnecting from endpoint %s", m_name.c_str()); closeConnections(); ... ``` I think it would be possible to use it, because `TcrEndpoint` object is not destroyed when endpoint disconnects from client. It would be used in test case something like this: ``` auto cacheImpl = CacheRegionHelper::getCacheImpl(cache.get()); // shut down one endpoint (server) ASSERT_EQ(cacheImpl->getNumberOfTimeEndpointDisconnected(poolName, epRunningHostname), 0); ASSERT_EQ(cacheImpl->getNumberOfTimeEndpointDisconnected(poolName, epDisconnectedHostname), 1); ``` `ThinClientPoolDM` is actually owner of `TcrEndpoint` collection, so `getNumberOfTimeEndpointDisconnected(endpoint)` would basically find given endpoint and return it's `numberOfTimesFailed()`. ---------------------------------------------------------------- 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 > Client disconnects from server due to exception on other server > --------------------------------------------------------------- > > Key: GEODE-8543 > URL: https://issues.apache.org/jira/browse/GEODE-8543 > Project: Geode > Issue Type: Bug > Components: native client > Reporter: Alberto Bustamante Reyes > Assignee: Jakov Varenina > Priority: Major > Labels: pull-request-available > > In ThinClientBaseDM::handleEPError when the client receives an exception from > a given endpoint, it will mark that server dead if in the exception contains > "java.lang.OutOfMemoryError", > "org.apache.geode.distributed.ShutdownException" or > "org.apache.geode.cache.CacheClosedException" ( in > ThinClientBaseDM::unrecoverableServerError() ) > The problem is that the server causing the exception can be a different > server than the endpoint the client is connected to. In that case, > the client will wrongly close a connection to a working server. -- This message was sent by Atlassian Jira (v8.3.4#803005)