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

Matthew Swift
22.49.2011 363abe75e33733aebdb139fdf421e87e4dc7a42a
Fix OPENDJ-292: LDAP PTA NPE when base-dn or bind-dn not exist on secondary server
1 files modified
12 ■■■■■ changed files
opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -74,6 +74,8 @@
  // TODO: handle password policy response controls? AD?
  // TODO: custom aliveness pings
  // TODO: cache password
  // TODO: handle idle timeouts (connection resets): implement retry logic in
  // connection pools.
  /**
   * A simplistic load-balancer connection factory implementation using
@@ -113,6 +115,10 @@
                incrementNextIndex();
                return;
              }
              else if (lastException == null)
              {
                lastException = factory.lastException;
              }
            }
            catch (final DirectoryException e)
            {
@@ -265,7 +271,10 @@
    private final class MonitoredConnectionFactory implements ConnectionFactory
    {
      private final ConnectionFactory factory;
      // isAvailable acts as memory barrier for lastException.
      private volatile boolean isAvailable = true;
      private DirectoryException lastException = null;
@@ -305,7 +314,8 @@
          {
            TRACER.debugCaught(DebugLogLevel.ERROR, e);
          }
          isAvailable = false;
          lastException = e;
          isAvailable = false; // publish lastException
          throw e;
        }
      }