Closed pbhogan closed 4 years ago
The connect method is here, for reference: https://github.com/rails-sqlserver/tiny_tds/blob/master/ext/tiny_tds/client.c#L308
You'd probably need to provide the full stack trace to get farther. The problem might not even be in tinytds (could be freetds).
The only other thing that jumps out at me is your protocol version 4.2, which is old. Is that set on purpose?
Protocol version 4.2 is not set on purpose. It's probably just the default when installing the package. We've customized nothing beyond just installing packages.
Environment
Operating System
Also happens on:
TinyTDS Version and Information
FreeTDS Version
On Debian:
On macOS:
Description
We are running a series of background jobs (with Sidekiq) to push information to a database with tiny_tds. There are around 50,000 jobs.
The vast majority of the jobs work perfectly, so it's not a configuration error. But on any given run there are about 5 to 10
TinyTds::Error: Server name not found in configuration files
errors occuring.And then at some point a
SystemStackError: stack level too deep
occurs and brings down the Sidekiq process entirely which then has to be restarted, after which the remainder of the jobs finish up without an issue (but this could just be due to the rarity of the error).Our connection is made like so:
We've had it happen with and without a connection pool (using the connection_pool gem), and with the jobs running parallelized or with them running one at a time.
It's also happening both in production on Debian 9 and in development on macOS 10.14.
Can you shed any light on why these errors might be occurring? The more critical one to solve is the
SystemStackError
as it's bringing down our job system entirely. It occurs in https://github.com/rails-sqlserver/tiny_tds/blob/f2fceb222e5bc8d461ec563c4a096730b5a8e7b3/lib/tiny_tds/client.rb#L60 which appears to be a call into the native extension.Why would
connect
throw aSystemStackError
? It seems like any kind of connection error should just be a simple error that can be retried later instead of what appears to be a recursion bug.