[ 
https://issues.apache.org/jira/browse/GEODE-8543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17250473#comment-17250473
 ] 

ASF GitHub Bot commented on GEODE-8543:
---------------------------------------

pivotal-jbarrett commented on a change in pull request #705:
URL: https://github.com/apache/geode-native/pull/705#discussion_r544472676



##########
File path: cppcache/integration/test/DisconnectEndPointAtException.cpp
##########
@@ -0,0 +1,195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <framework/Cluster.h>
+#include <framework/Gfsh.h>
+#include <framework/TestConfig.h>
+
+#include <thread>
+
+#include <geode/Cache.hpp>
+#include <geode/CacheFactory.hpp>
+#include <geode/CacheTransactionManager.hpp>
+#include <geode/Region.hpp>
+#include <geode/RegionFactory.hpp>
+#include <geode/RegionShortcut.hpp>
+
+namespace {
+using apache::geode::client::Cache;
+using apache::geode::client::CacheableString;
+using apache::geode::client::CacheFactory;
+using apache::geode::client::CacheTransactionManager;
+using apache::geode::client::Pool;
+using apache::geode::client::Region;
+using apache::geode::client::RegionShortcut;
+using std::cout;
+
+std::string disconnectingStr("Disconnecting from endpoint");
+
+std::string getClientLogName() {

Review comment:
       Using log output is not a safe way to write a test. Is there something 
else we can hook to test the disconnect scenario? 
   
   Could this code change not be refactored for a unit test?
   Could we add hooks on some internal interface for getting events server 
disconnects?




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

Reply via email to