/** * test hook */ public void endpointsNetDownForDUnitTest() { logger.debug("PoolImpl - endpointsNetDownForDUnitTest"); setTEST_DURABLE_IS_NET_DOWN(true); try { Thread.sleep(this.pingInterval * 2); } catch (java.lang.InterruptedException ignore) { // do nothing. } Map endpoints = endpointManager.getEndpointMap(); for (Iterator itr = endpoints.values().iterator(); itr.hasNext();) { Endpoint endpoint = (Endpoint) itr.next(); logger.debug("PoolImpl Simulating crash of endpoint {}", endpoint); endpointManager.serverCrashed(endpoint); } }
@Override public void run2() { if (endpoint.timeToPing(pingIntervalNanos)) { try { PingOp.execute(pool, endpoint.getLocation()); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Error occurred while pinging server: {} - {}", endpoint.getLocation(), e.getMessage()); } InternalCache cache = GemFireCacheImpl.getInstance(); if (cache != null) { ClientMetadataService cms = cache.getClientMetadataService(); cms.removeBucketServerLocation(endpoint.getLocation()); } // any failure to ping the server should be considered a crash (eg. // socket timeout exception, security exception, failure to connect). pool.getEndpointManager().serverCrashed(endpoint); } } } }
conn.destroy(); if (invalidateServer) { endpointManager.serverCrashed(conn.getEndpoint());
logger.isDebugEnabled() ? e : null); eManager.serverCrashed(this.endpoint); } catch (ClassNotFoundException e) { if (!quitting()) {
verify(endpointManager).serverCrashed(endpoint);
this.eManager.serverCrashed(this.endpoint); if (isDebugEnabled) { logger.debug("Caught the following exception and will exit", e); ClientServerObserver clientServerObserver = ClientServerObserverHolder.getInstance(); clientServerObserver.beforeFailoverByCacheClientUpdater(this.location); this.eManager.serverCrashed(this.endpoint); String message = ": Caught the following exception and will exit: "; handleException(message, e);