Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

ECONNRESET when attempting bind or search even with reconnect set to true #823

Closed
AustinMutschler opened this issue Nov 29, 2022 · 3 comments

Comments

@AustinMutschler
Copy link

We have been getting a Reconnect error with idle clients.

We do have reconnect: true but it only appears to reconnect after the bind or search fails which then means we need to build our own custom retry logic for the bind and search.

In general, is it advisable to use one LDAP client for all binds and searches or a new LDAP client for each bind? We are trying to decide on the best approach. We don't want to make a lot of LDAP clients that are sitting idle after they are finished being used. What would be a good way to close these connections when they are no longer needed?

@jsumners
Copy link
Member

In my experience, LDAP connections are generally used for a single conversation.

@Evi-str
Copy link

Evi-str commented Feb 1, 2023

@jsumners we also were wondering if it's necessary to create a new ldap client for each and every request. We finally decided to create just a single client instance and pass those instance to several sub functions which call bind() unbind() for each search request

  1. client = ldap.createClient()
  2. bind(), search(groupFilter), unbind() -> in order to get a large list of groups
  3. For all members of those groups, we asynchronously send further search requests (via promise + throtteling) in order to fetch all member detail information: bind() search(userFiler) unbind()
  4. process.exit()

We talk about 2000-3000 members here. We use the same client for all requests. So far it works, but when using fast throtteling settings and/or large ldapjs timeout settings (like e.g. 20000 ms) we experience a lot of unsolicited erros like [02:07:39.620] ERROR (ldap-client/13296): unsolicited message and also errors like ConnectionError: 24__ldaps://my.server.intern:3070 closed

As a workaround we also use own retry code (using npm retry package). But the behaviour is strange.

Also tried to listen to various events: http://ldapjs.org/client.html#client-events, but it seems that events like res.on('timeout' err =>etc.) are not possible ? res.on('error') works, though.

@jsumners
Copy link
Member

👋

On February 22, 2023, we released version 3 of this library. As a result, we are closing this issue/pull request.

Please see issue #839 for more information, including how to proceed if you feel this closure is in error.

@ldapjs ldapjs locked as resolved and limited conversation to collaborators Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants