txstate-etc / ldap-async

A wrapper around ldapjs to provide promises, pooling, config by environment, and other conveniences.
MIT License
11 stars 5 forks source link

How to deal with the 'ECONNRESET' #2

Closed yanwii closed 3 years ago

yanwii commented 3 years ago

In ldapjs, we can handle the error by binding the error event to reconnect the ldap server, just like:

client.on('error', function(err) {
    console.warn('LDAP connection failed, but fear not, it will reconnect OK', err);
});

But how to implement it in ldap-async?

wickning1 commented 3 years ago

We recently got this into production and noticed the same problem. I just pushed out a potential fix. Will keep an eye on it in our own environment to make sure the reconnects are happening appropriately.