Closed amachanic closed 4 years ago
There are two: login_timeout
and timeout
(https://zillow.github.io/ctds/ctds.html#ctds.connect).
Sadly FreeTDS only supports second resolution for these parameters, but they are distinct.
Thanks for clarifying. I was looking at the documentation here and didn't see it: https://zillow.github.io/ctds/connection.html
Ahh. Yes, that is for the Connection
object which is returned by ctds.connect
. The only way to create a Connection
object that is actually connected to the database is using ctds.connect
Currently, if I'm understanding correctly, there is exactly one timeout parameter available, on the connect function, and it is used both as connection timeout and then later as query timeout.
This is really not ideal; I often don't want to wait a long time to connect if the server is down, but I do want to wait a long time for my query to finish once I'm connected and it's actually running.
My preference would be to never conflate these two things at all. But given backward compatibility, what I would like to see changed in ctds in the addition of a second parameter, "query_timeout", which will work specifically and separately from the "timeout" parameter. If "query_timeout" is not provided, the existing parameter will continue to perform double-duty as it currently does.