directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r797289 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Date Fri, 24 Jul 2009 00:59:30 GMT
Author: elecharny
Date: Fri Jul 24 00:59:30 2009
New Revision: 797289

URL: http://svn.apache.org/viewvc?rev=797289&view=rev
Log:
Used an UnorderedThreadPoolExecutor, filtering only MESSAGE_RECEIVED events, in order to fix
two bad bugs :
- a potential OOM if some request is sent and as a result returns thousands of entries, all
stored in memory until the search has completed
- the abandonRequest wasn't handled before all the previous requests were completely processed,
defeating its purpose. This is DIRSERVER-1384

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=797289&r1=797288&r2=797289&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Fri Jul 24 00:59:30 2009
@@ -85,11 +85,12 @@
 import org.apache.mina.core.filterchain.IoFilterChainBuilder;
 import org.apache.mina.core.future.WriteFuture;
 import org.apache.mina.core.service.IoHandler;
+import org.apache.mina.core.session.IoEventType;
 import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.apache.mina.filter.executor.ExecutorFilter;
-import org.apache.mina.filter.executor.OrderedThreadPoolExecutor;
+import org.apache.mina.filter.executor.UnorderedThreadPoolExecutor;
 import org.apache.mina.handler.demux.MessageHandler;
 import org.apache.mina.transport.socket.SocketAcceptor;
 import org.slf4j.Logger;
@@ -380,7 +381,8 @@
             // (NOTE : this has to be double checked)
             ((DefaultIoFilterChainBuilder)chain).addLast( "executor", 
                     new ExecutorFilter( 
-                        new OrderedThreadPoolExecutor( transport.getNbThreads() ) ) );
+                        new UnorderedThreadPoolExecutor( transport.getNbThreads() ),
+                        IoEventType.MESSAGE_RECEIVED ) );
 
             /*
              * The server is now initialized, we can



Mime
View raw message