mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-26 01:48:45 +00:00
This commit migrates the actual authentication calls that are performed by internal realms to be asynchronous so that we do not execute blocking calls on network threads. The realms that used LDAP were especially bad as they can issue many different requests and/or open multiple connections per authentication attempt. The LdapRealm now uses the ThreadPool to fork a thread for authentication. This is necessary because a LDAP bind operation is not allowed to be performed asynchronously and must be done in a blocking manner. After the bind request has completed, all other requests can be done asynchrnously. The LdapUtils class now provides asynchronous methods for searching and also includes the handling of referral following as automated following is not supported by UnboundID when using the asynchronous calls. Original commit: elastic/x-pack-elasticsearch@dfb259e498