ruby-net-ldap
ruby-net-ldap copied to clipboard
Net::LDAP::ConnectionError swallows Errno::ETIMEDOUT
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
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
SystemCallError is base class for Errno exceptions that's why they get rescued here.