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

Matthew Swift
05.37.2011 20800de857e9658dc3229b7535be742a0709acb9
Partial fix for OPENDJ-115: Make replication connection timeouts and various monitoring intervals configurable

Try increasing connection timeouts from 500ms to 4s in order to tolerate slow. Values are hard-coded for now, but this will at least indicate if network timeouts are the cause of unit test failures.
5 files modified
17 ■■■■■ changed files
opends/src/server/org/opends/server/replication/protocol/ReplSessionSecurity.java 5 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServer.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/service/ReplicationBroker.java 2 ●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/AssuredReplicationServerTest.java 2 ●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java 6 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/protocol/ReplSessionSecurity.java
@@ -83,6 +83,11 @@
   */
  public static final int HANDSHAKE_TIMEOUT = 4000;
  /**
   * The default connection timeout.
   */
  public static final int CONNECTION_TIMEOUT = 4000;
  /**
opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -522,7 +522,7 @@
      InetSocketAddress ServerAddr = new InetSocketAddress(
          InetAddress.getByName(hostname), Integer.parseInt(port));
      socket.setTcpNoDelay(true);
      socket.connect(ServerAddr, 500);
      socket.connect(ServerAddr, ReplSessionSecurity.CONNECTION_TIMEOUT);
      session = replSessionSecurity.createClientSession(socket,
          ReplSessionSecurity.HANDSHAKE_TIMEOUT);
opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
@@ -1179,7 +1179,7 @@
      socket = new Socket();
      socket.setReceiveBufferSize(1000000);
      socket.setTcpNoDelay(true);
      socket.connect(serverAddr, 500);
      socket.connect(serverAddr, ReplSessionSecurity.CONNECTION_TIMEOUT);
      localSession = replSessionSecurity.createClientSession(
          socket, ReplSessionSecurity.HANDSHAKE_TIMEOUT);
      boolean isSslEncryption = replSessionSecurity
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/AssuredReplicationServerTest.java
@@ -953,7 +953,7 @@
          new InetSocketAddress("localhost", port);
        Socket socket = new Socket();
        socket.setTcpNoDelay(true);
        socket.connect(serverAddr, 500);
        socket.connect(serverAddr, ReplSessionSecurity.CONNECTION_TIMEOUT);
        // Create client session
        fakePort++;
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java
@@ -198,7 +198,7 @@
    newClientWithFirstChanges();
    newClientWithChangefromServer1();
    newClientWithChangefromServer2();
    newClientWithUnknownChanges();
    newClientWithUnknownChanges();
    stopChangelog();
    exportBackend();
    backupRestore();
@@ -770,7 +770,7 @@
    debugInfo("Starting changelogChaining");
    replicationServer.clearDb();
    TestCaseUtils.initializeTestBackend(true);
    for (int itest = 0; itest <2; itest++)
    {
      ReplicationBroker broker2 = null;
@@ -1010,7 +1010,7 @@
    Socket socket = new Socket();
    socket.setReceiveBufferSize(1000000);
    socket.setTcpNoDelay(true);
    socket.connect(ServerAddr, 500);
    socket.connect(ServerAddr, ReplSessionSecurity.CONNECTION_TIMEOUT);
    ReplSessionSecurity replSessionSecurity = getReplSessionSecurity();
    ProtocolSession session =
         replSessionSecurity.createClientSession(socket,