use of org.apache.geode.internal.tcp.ConnectionException in project geode by apache.
the class LocatorDiscovery method exchangeLocalLocators.
private void exchangeLocalLocators() {
int retryAttempt = 1;
while (!getDiscoverer().isStopped()) {
try {
RemoteLocatorJoinResponse response = (RemoteLocatorJoinResponse) locatorClient.requestToServer(locatorId.getHost(), locatorId.getPort(), request, WanLocatorDiscoverer.WAN_LOCATOR_CONNECTION_TIMEOUT);
if (response != null) {
LocatorHelper.addExchangedLocators(response.getLocators(), this.locatorListener);
logger.info(LocalizedMessage.create(LocalizedStrings.LOCATOR_DISCOVERY_TASK_EXCHANGED_LOCATOR_INFORMATION_0_WITH_1, new Object[] { request.getLocator(), locatorId, response.getLocators() }));
break;
}
} catch (IOException ioe) {
if (retryAttempt == WAN_LOCATOR_CONNECTION_RETRY_ATTEMPT) {
ConnectionException coe = new ConnectionException("Not able to connect to local locator after " + WAN_LOCATOR_CONNECTION_RETRY_ATTEMPT + " retry attempts", ioe);
logger.fatal(LocalizedMessage.create(LocalizedStrings.LOCATOR_DISCOVERY_TASK_COULD_NOT_EXCHANGE_LOCATOR_INFORMATION_0_WITH_1_AFTER_2, new Object[] { request.getLocator(), locatorId, retryAttempt }), coe);
break;
}
if (skipFailureLogging(locatorId)) {
logger.warn(LocalizedMessage.create(LocalizedStrings.LOCATOR_DISCOVERY_TASK_COULD_NOT_EXCHANGE_LOCATOR_INFORMATION_0_WITH_1_AFTER_2_RETRYING_IN_3_MS, new Object[] { request.getLocator(), locatorId, retryAttempt, WAN_LOCATOR_CONNECTION_INTERVAL }));
}
try {
Thread.sleep(WAN_LOCATOR_CONNECTION_INTERVAL);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
retryAttempt++;
continue;
} catch (ClassNotFoundException classNotFoundException) {
logger.fatal(LocalizedMessage.create(LocalizedStrings.LOCATOR_DISCOVERY_TASK_ENCOUNTERED_UNEXPECTED_EXCEPTION), classNotFoundException);
break;
}
}
}
use of org.apache.geode.internal.tcp.ConnectionException in project geode by apache.
the class GMSMemberFactory method newMembershipManager.
public MembershipManager newMembershipManager(DistributedMembershipListener listener, DistributionConfig config, RemoteTransportConfig transport, DMStats stats) throws DistributionException {
Services services = new Services(listener, config, transport, stats);
try {
services.init();
services.start();
} catch (ConnectionException e) {
throw new DistributionException(LocalizedStrings.MemberFactory_UNABLE_TO_CREATE_MEMBERSHIP_MANAGER.toLocalizedString(), e);
} catch (GemFireConfigException | SystemConnectException | GemFireSecurityException e) {
throw e;
} catch (RuntimeException e) {
Services.getLogger().error("Unexpected problem starting up membership services", e);
throw new SystemConnectException("Problem starting up membership services", e);
}
return (MembershipManager) services.getManager();
}
Aggregations