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

gbellato
05.36.2007 69f39165afd0d36b6181db550bb54ad03963150f
Fix for issue 1879 : null pointer Exception when running on a machine with 
badly configure named resolution.

The fix is simply to check for null pointers when calling the shutdown method
of the replication server and the setSoTimeout of the replicationBroker.

The fix is simple enough so that I did not feel the need to build a test case.
2 files modified
21 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/ReplicationBroker.java 5 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java 16 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/ReplicationBroker.java
@@ -727,7 +727,10 @@
  public void setSoTimeout(int timeout) throws SocketException
  {
    this.timeout = timeout;
    session.setSoTimeout(timeout);
    if (session != null)
    {
      session.setSoTimeout(timeout);
    }
  }
  /**
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -424,19 +424,18 @@
    shutdown = true;
    // shutdown the connect thread
    try
    if (myConnectThread != null)
    {
      myConnectThread.interrupt();
    } catch (NullPointerException e)
    {
      // FIXME To be investigated the conditions
      // where myConnectThread can be null here
    }
    // shutdown the listener thread
    try
    {
      listenSocket.close();
      if (listenSocket != null)
      {
        listenSocket.close();
      }
    } catch (IOException e)
    {
      // replication Server service is closing anyway.
@@ -448,7 +447,10 @@
      replicationCache.shutdown();
    }
    dbEnv.shutdown();
    if (dbEnv != null)
    {
      dbEnv.shutdown();
    }
    DirectoryServer.deregisterMonitorProvider(getMonitorInstanceName());
  }