Failed connections infinitely create file descriptors
Issue
Whenever a connection is attempted, or a connection is lost, several file descriptors are opened and are never removed. This is a problem as our Puma server eventually hits the open file limit and crashes, as well as our delayed_job jobs eventually also hitting the file limit and manifesting different errors.
Expected behavior
Should not create infinite file descriptors.
Actual behavior
Creates file descriptors infinitely, removed only when the process for the application is killed.
How to reproduce
Use ActiveRecord and establish a connection to a database that is not available. Infinitely loop an attempt to run a query on that connection. Check the amount of file descriptors going up with each attempt, infinitely.
Details
-
Rails version:
5.2.8 -
SQL Server adapter version:
5.2.1 -
TinyTDS version:
2.1.2 -
FreeTDS details:
Compile-time settings (established with the "configure" script) Version: freetds v1.2.18 freetds.conf directory: /usr/local/etc MS db-lib source compatibility: no Sybase binary compatibility: no Thread safety: yes iconv library: yes TDS version: 7.3 iODBC: no unixodbc: no SSPI "trusted" logins: no Kerberos: no OpenSSL: yes GnuTLS: no MARS: yes