mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
14.36.2008 48e7fa056f25f90a6c046ede3ad12aa804edb4d4
Fix for issue 2958 (The timeout in ServerController to establish connection is too short)

The fix consists of increasing the timeout to establish the connection (using the default time out defined in ConnectionUtils). Appart from that some debug lines have been added to be able to track some issues in the replication tool and the timeout to discover the topology in TopologyCache has also been increased.
5 files modified
25 ■■■■ changed files
opends/src/ads/org/opends/admin/ads/TopologyCache.java 2 ●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java 13 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java 1 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java 2 ●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java 7 ●●●● patch | view | raw | blame | history
opends/src/ads/org/opends/admin/ads/TopologyCache.java
@@ -59,7 +59,7 @@
  private Set<SuffixDescriptor> suffixes = new HashSet<SuffixDescriptor>();
  private final boolean isMultiThreaded = true;
  private final static int MULTITHREAD_TIMEOUT = 30000;
  private final static int MULTITHREAD_TIMEOUT = 90 * 1000;
  private static final Logger LOG =
    Logger.getLogger(TopologyCache.class.getName());
opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java
@@ -335,6 +335,7 @@
      }
      if (returnValue == SUCCESSFUL_NOP)
      {
        boolean subcommandLaunched = true;
        if (argParser.isEnableReplicationSubcommand())
        {
          returnValue = enableReplication();
@@ -368,6 +369,18 @@
          println(ERR_REPLICATION_VALID_SUBCOMMAND_NOT_FOUND.get());
          println(Message.raw(argParser.getUsage()));
          returnValue = ERROR_USER_DATA;
          subcommandLaunched = false;
        }
        if (subcommandLaunched)
        {
          File logFile = QuickSetupLog.getLogFile();
          if (logFile != null)
          {
            println();
            println(INFO_GENERAL_SEE_FOR_DETAILS.get(logFile.getPath()));
            println();
          }
        }
      }
    }
opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java
@@ -1383,6 +1383,7 @@
            ReturnCode.WINDOWS_SERVICE_ERROR,
                errorMessage, null);
    }
    notifyListeners(getLineBreak());
  }
  private UninstallUserData getUninstallUserData() {
opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
@@ -355,7 +355,7 @@
      // seems necessary currenty for the case in which shutdown
      // is called immediately afterward as is done by the upgrader.
      // Connection handlers are stopped and started asynchonously.
      // Connection handlers are stopped and started asynchronously.
      // Give the connection handlers time to initialize before
      // continuing.
opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
@@ -27,6 +27,7 @@
package org.opends.quicksetup.util;
import org.opends.admin.ads.util.ConnectionUtils;
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import static org.opends.messages.QuickSetupMessages.*;
@@ -418,17 +419,19 @@
          }
          InitialLdapContext ctx = null;
          for (int i=0; i<10 && !connected; i++)
          for (int i=0; i<20 && !connected; i++)
          {
            try
            {
              ctx = Utils.createLdapContext(
                  ldapUrl,
                  userDn, userPw, 3000, null);
                  userDn, userPw, ConnectionUtils.getDefaultLDAPTimeout(),
                  null);
              connected = true;
            }
            catch (NamingException ne)
            {
              LOG.log(Level.WARNING, "Could not connect to server: "+ne, ne);
            }
            finally
            {