directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r566769 - in /directory/apacheds/trunk: core/src/main/java/org/apache/directory/server/core/configuration/ core/src/main/java/org/apache/directory/server/core/jndi/ server-jndi/src/main/java/org/apache/directory/server/jndi/ server-unit/src...
Date Thu, 16 Aug 2007 16:36:42 GMT
Author: akarasulu
Date: Thu Aug 16 09:36:38 2007
New Revision: 566769

URL: http://svn.apache.org/viewvc?view=rev&rev=566769
Log:
Fixed bug arrising from corrections made to fix DIRSERVER-1019 ...

Seems as though the fixes for this revealed an inconsistent state that occurs in
the poorly written filter parser.  I have created another JIRA to rewrite the 
filter parser here:

   https://issues.apache.org/jira/browse/DIRSERVER-1020

Anyways I found a work around which hides the symptoms instead of curring this 
disease.  The cure is a parser rewrite in the nice way that seelmann did it for
the other parsers.  The work around I used was to make the filter parser in the
ServerDirContext implementation a instance member instead of a static class 
member.  Again this just hides the issue rather than fixing it.


Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
    directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java?view=diff&rev=566769&r1=566768&r2=566769
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
Thu Aug 16 09:36:38 2007
@@ -103,7 +103,7 @@
 
     private static final long serialVersionUID = 4826762196566871677L;
 
-    public static final int MAX_THREADS_DEFAULT = 4;
+    public static final int MAX_THREADS_DEFAULT = 32;
     public static final int MAX_SIZE_LIMIT_DEFAULT = 100;
     public static final int MAX_TIME_LIMIT_DEFAULT = 10000;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?view=diff&rev=566769&r1=566768&r2=566769
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
Thu Aug 16 09:36:38 2007
@@ -768,7 +768,7 @@
     // EventDirContext implementations
     // ------------------------------------------------------------------------
 
-    private static final FilterParserImpl filterParser = new FilterParserImpl();
+    private final FilterParserImpl filterParser = new FilterParserImpl();
 
 
     public void addNamingListener( Name name, String filterStr, SearchControls searchControls,

Modified: directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?view=diff&rev=566769&r1=566768&r2=566769
==============================================================================
--- directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
(original)
+++ directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
Thu Aug 16 09:36:38 2007
@@ -555,8 +555,9 @@
 
         try
         {
-            // Disable the disconnection of the clients on unbind
             SocketAcceptorConfig acceptorCfg = new SocketAcceptorConfig();
+
+            // Disable the disconnection of the clients on unbind
             acceptorCfg.setDisconnectOnUnbind( false );
             acceptorCfg.setReuseAddress( true );
             acceptorCfg.setFilterChainBuilder( chainBuilder );

Modified: directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java?view=diff&rev=566769&r1=566768&r2=566769
==============================================================================
--- directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
(original)
+++ directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
Thu Aug 16 09:36:38 2007
@@ -21,6 +21,7 @@
 
 
 import java.util.ArrayList;
+import java.util.EventObject;
 import java.util.Hashtable;
 
 import javax.naming.NamingEnumeration;
@@ -133,14 +134,16 @@
         Thread t = new Thread( listener, "PSearchListener" );
         t.start();
 
+        // let's wait until the listener thread started
         while ( !listener.isReady )
         {
             Thread.sleep( 100 );
         }
+        // Now we wait until the listener is registered (timing dependent crap)
         Thread.sleep( 250 );
 
-        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new AttributesImpl( "description",
PERSON_DESCRIPTION,
-            true ) );
+        ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, 
+            new AttributesImpl( "description", PERSON_DESCRIPTION, true ) );
         long start = System.currentTimeMillis();
         while ( t.isAlive() )
         {
@@ -515,7 +518,7 @@
      */
     public void testPsearchUsingJndiNotifications() throws Exception
     {
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
         env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/ou=system" );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );
@@ -535,8 +538,16 @@
             ctx.destroySubcontext( rdn );
         }
 
-        NamingEvent event = ( NamingEvent ) listener.list.get( 0 );
-        assertEquals( edc, event.getSource() );
+        if ( ! listener.hasError )
+        {
+            EventObject event = listener.list.get( 0 );
+            assertEquals( edc, event.getSource() );
+        }
+        else
+        {
+            throw new RuntimeException( "got naming exception while processing events", 
+                listener.exceptionEvent.getException() );
+        }
     }
 
 
@@ -612,8 +623,9 @@
 
     class JndiNotificationListener implements NamespaceChangeListener, ObjectChangeListener
     {
-        ArrayList list = new ArrayList();
-
+        boolean hasError = false;
+        ArrayList<EventObject> list = new ArrayList();
+        NamingExceptionEvent exceptionEvent = null;
 
         public void objectAdded( NamingEvent evt )
         {
@@ -635,6 +647,8 @@
 
         public void namingExceptionThrown( NamingExceptionEvent evt )
         {
+            hasError = true;
+            exceptionEvent = evt;
             list.add( 0, evt );
         }
 



Mime
View raw message