Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InMemoryDirectoryServer is single threaded and blocks for searches #163

Open
ofiterev opened this issue Apr 18, 2024 · 1 comment · May be fixed by #164
Open

InMemoryDirectoryServer is single threaded and blocks for searches #163

ofiterev opened this issue Apr 18, 2024 · 1 comment · May be fixed by #164

Comments

@ofiterev
Copy link

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

ofiterev added a commit to ofiterev/ldapsdk_inmem that referenced this issue Apr 19, 2024
…MemoryRequestHandler so multiple reads can be executed at a time when no write is done

Resolves pingidentity#163
@dirmgr
Copy link
Collaborator

dirmgr commented Apr 26, 2024

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:

  • I had been concerned that there may be use cases in the future in which operations that are currently read-only might require making changes to the data in some form (e.g., maintaining password policy state for bind operations, or perhaps updating other state information for other kinds of read operations).
  • The in-memory directory server is primarily meant for some relatively simple use cases, and especially for use in things like unit tests for LDAP-enabled applications, where performance is typically not a substantial concern.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants