pingidentity / ldapsdk

UnboundID LDAP SDK for Java
Other
327 stars 79 forks source link

InMemoryDirectoryServer is single threaded and blocks for searches #163

Open ofiterev opened 3 months ago

ofiterev commented 3 months ago

InMemoryDirectoryServer is single threaded and blocks for searches because InMemoryRequestHandler synchronizes every search method on the entryMap, insead read/write locks can be used so multiple threads can read if no thread writes

dirmgr commented 3 months ago

I apologize for not responding to this earlier.

This is something that I had considered in the past, but avoided for a couple of reasons:

However, I have gone ahead and updated the LDAP SDK to make changes to support concurrency for methods that don't attempt to make any changes to the data. I didn't look at the pull request that you submitted because we don't currently accept third-party contributions (as noted here). These changes will be included in the next release of the LDAP SDK (which will probably be out by the end of June, although there's no hard schedule as yet), but you can test them now by checking out and building the LDAP SDK for yourself.