@Override public Connection call() throws Exception { final ReconnectPolicy reconnectPolicy = ReconnectPolicy.RECONNECT; int reconnectionCount = 0; for(;;) { // Try to connect to the remote host controller by looping through all // discovery options reconnectPolicy.wait(reconnectionCount); HostControllerLogger.ROOT_LOGGER.reconnectingToMaster(); for (Iterator<DiscoveryOption> i = discoveryOptions.iterator(); i.hasNext(); ) { DiscoveryOption discoveryOption = i.next(); URI masterURI = null; try { List<RemoteDomainControllerConnectionConfiguration> remoteDcConfigs = discoveryOption.discover(); for (RemoteDomainControllerConnectionConfiguration remoteDcConfig : remoteDcConfigs) { try { return connect(remoteDcConfig); } catch (IOException ioe) { // If the cause is one of the irrecoverable ones, unwrap and throw it on RemoteDomainConnectionService.rethrowIrrecoverableConnectionFailures(ioe); } } } catch (Exception e) { RemoteDomainConnectionService.logConnectionException(masterURI, discoveryOption, i.hasNext(), e); } } reconnectionCount++; } } });
@Override public Connection call() throws Exception { final ReconnectPolicy reconnectPolicy = ReconnectPolicy.RECONNECT; int reconnectionCount = 0; for(;;) { // Try to connect to the remote host controller by looping through all // discovery options reconnectPolicy.wait(reconnectionCount); HostControllerLogger.ROOT_LOGGER.reconnectingToMaster(); for (Iterator<DiscoveryOption> i = discoveryOptions.iterator(); i.hasNext(); ) { DiscoveryOption discoveryOption = i.next(); URI masterURI = null; try { List<RemoteDomainControllerConnectionConfiguration> remoteDcConfigs = discoveryOption.discover(); for (RemoteDomainControllerConnectionConfiguration remoteDcConfig : remoteDcConfigs) { try { return connect(remoteDcConfig); } catch (IOException ioe) { // If the cause is one of the irrecoverable ones, unwrap and throw it on RemoteDomainConnectionService.rethrowIrrecoverableConnectionFailures(ioe); } } } catch (Exception e) { RemoteDomainConnectionService.logConnectionException(masterURI, discoveryOption, i.hasNext(), e); } } reconnectionCount++; } } });
@Override public Connection call() throws Exception { final ReconnectPolicy reconnectPolicy = ReconnectPolicy.RECONNECT; int reconnectionCount = 0; for(;;) { try { // reconnectPolicy.wait(reconnectionCount); HostControllerLogger.ROOT_LOGGER.debugf("trying to reconnect to remote host-controller"); // Try to the connect to the remote host controller return connectionManager.connect(); } catch (IOException e) { HostControllerLogger.ROOT_LOGGER.debugf(e, "failed to reconnect to the remote host-controller"); } finally { reconnectionCount++; } } } });
ReconnectPolicy.CONNECT.wait(retries); retries++; } catch (InterruptedException ie) {
ReconnectPolicy.CONNECT.wait(retries); retries++; } catch (InterruptedException ie) {
ReconnectPolicy.CONNECT.wait(retries); retries++; } catch (InterruptedException ie) {