On Sun, Mar 14, 2010 at 7:51 AM, Thomas Cataldo <[email protected]> wrote:
> On Fri, Mar 12, 2010 at 3:33 PM, Kiran Ayyagari <[email protected]>
> wrote:
>> hi Thomas,
>>
>> I have fixed the LdapConnection class on trunk, which I think
>> should fix the problems you reported, can you try with the latest
>> trunk?
>
> All my searches now seem to run fine. Good job :-)
>
> I'll make some more tests and tell you if I find anything odd.
>
As my tests where running, I'm now doing some loops around my tests to
check everything is stable
public void testFindLoop() {
LDAPUtils utils = new LDAPUtils("obm23.buffy.kvm", null, null,
"ou=users,dc=zz.com,dc=local");
int count = 1000;
long time = System.currentTimeMillis();
for (int i = 0; i < count; i++) {
LdapConnection con = null;
try {
con = utils.getConnection();
String dn = utils.findUniqueDN("(uid=thomas)",
con);
assertNotNull(dn);
} catch (Throwable t) {
t.printStackTrace();
fail(t.getMessage());
} finally {
utils.cleanUp(con);
}
}
time = System.currentTimeMillis() - time;
System.err.println(count + " iterations done in " + time + "ms.
"
+ (1000000 / time) + "/sec.");
}
This test shows random stack traces :
2010-03-14 07:59:31,633 Asn1Decoder WARN - The PDU has been fully
decoded but there are still bytes in the buffer.
2010-03-14 07:59:31,634 DefaultExceptionMonitor WARN - Unexpected exception.
java.nio.channels.ClosedSelectorException
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:66)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
at
org.apache.mina.transport.socket.nio.NioProcessor.select(NioProcessor.java:69)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:961)
at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
2010-03-14 07:59:31,639 Asn1Decoder WARN - The PDU has been fully
decoded but there are still bytes in the buffer.
2010-03-14 07:59:31,644 Asn1Decoder WARN - The PDU has been fully
decoded but there are still bytes in the buffer.
2010-03-14 07:59:31,650 Asn1Decoder WARN - The PDU has been fully
decoded but there are still bytes in the buffer.