Le 6/27/12 5:23 PM, Hendy Irawan a écrit :
Hi ApacheDS developers,

I'm working on an open source project (
https://github.com/soluvas/ldap-tools ) which uses LdapNetworkConnection
using shared v1.0.0-M12. Several threads are running in parallel (using
Akka), all using the same LdapNetworkConnection to delete entries.

It's not necessarily a good idea to use a single connection in many threads. Think about it as if they where JDBC connections.

Note that it should be supported, as the response are associated with a request ID, which is incremented everytime you send a new request (and the responses are associated with the requestID, so we should not have a problem here.)

I suggest you fill a JIRA expliciting the problem, we will investigate.

In the mean ime, I assume it's safer to use one connection per thread.
However in some cases it locks up (deadlock? race condition?) and the last
logs I get is :

...
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [ldap_cli-akka.actor.default-dispatcher-14] INFO
o.soluvas.ldaptools.cli.PersonClear - Deleting
uid=setsuna_hinagiku,ou=users,dc=berbatik,dc=com
22:17:17 [ldap_cli-akka.actor.default-dispatcher-24] INFO
o.soluvas.ldaptools.cli.PersonClear - Deleting
uid=rumah_amal_salman_itb,ou=users,dc=berbatik,dc=com
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [ldap_cli-akka.actor.default-dispatcher-18] INFO
o.soluvas.ldaptools.cli.PersonClear - Deleting
uid=setyo_rini,ou=users,dc=berbatik,dc=com
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [ldap_cli-akka.actor.default-dispatcher-1] INFO
o.soluvas.ldaptools.cli.PersonClear - Deleting
uid=pipit_nugroho,ou=users,dc=berbatik,dc=com
22:17:17 [ldap_cli-akka.actor.default-dispatcher-15] INFO
o.soluvas.ldaptools.cli.PersonClear - Deleting
uid=yuliana_riris_basaria,ou=users,dc=berbatik,dc=com
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [ldap_cli-akka.actor.default-dispatcher-16] INFO
o.soluvas.ldaptools.cli.PersonClear - Deleting
uid=setia_budi,ou=users,dc=berbatik,dc=com
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1
22:17:17 [NioProcessor-2] DEBUG o.a.m.f.codec.ProtocolCodecFilter -
Processing a MESSAGE_RECEIVED for session 1

I also experience similar issues doing concurrent add()s.

Is LdapNetworkConnection meant to be thread-safe? Or should I just use
separate LdapConnection for each thread?




--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Reply via email to