ruby-net-ldap icon indicating copy to clipboard operation
ruby-net-ldap copied to clipboard

Net::LDAP::ConnectionError swallows Errno::ETIMEDOUT

Open davispuh opened this issue 5 years ago • 2 comments

Currently if SSL timeout occurs then Errno::ETIMEDOUT will be raised in wrap_with_ssl but later in open_connection it will be caught and created as Net::LDAP::ConnectionError. But Net::LDAP::ConnectionError will lose all information about it and it can only be caught as Net::LDAP::Error which covers pretty much everything.

So currently to retry temporary issues (ie. timeout) you have to compare Net::LDAP::Error message with "Connection timed out - OpenSSL connection read timeout" for this.

I think Net::LDAP::ConnectionError should do same for Errno::ETIMEDOUT as it does for Errno::ECONNREFUSED

davispuh avatar May 08 '20 15:05 davispuh

It doesn't look like Errno::ETIMEDOUT is one of the rescued errors here.

https://github.com/ruby-ldap/ruby-net-ldap/blob/e25b8810a1eae7b662a6a9d756417eb0ad4ea2e0/lib/net/ldap/connection.rb#L64-L65

HarlemSquirrel avatar Jun 27 '20 15:06 HarlemSquirrel

SystemCallError is base class for Errno exceptions that's why they get rescued here.

davispuh avatar Jun 27 '20 20:06 davispuh