Skip to Content.
Sympa Menu

freetds - Re: [freetds] Connection timeout

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Connection timeout
  • Date: Thu, 10 Jul 2008 11:47:12 -0400

Suren A. Chilingaryan wrote:
>
> The FreeTDS library (src/tds/login.c, 'tds_connect' function) uses
> 'connection->connect_timeout' to define timeout for tds_connect. This
> 'connection->connect_timeout' is defined by FreeTDS configuration file
> or by FreeTDS ODBC driver (src/odbc/odbc.c, 'odbc_connect' function).
>
> In the last case the 'dbc->attr.connection_timeout' is used. However,
> 'connection_timeout' is actually related 'SQL_ATTR_CONNECTION_TIMEOUT'
> ODBC connection attribute.
>
> From my point of view, the 'dbc->attr.login_timeout' (related to
> 'SQL_ATTR_LOGIN_TIMEOUT') should be used instead.

It's funny you should mention this just now, when I happen to be thinking
about connecting and logging in.

You seem to have identified an error, but IMO yours is not the correct
fix. The trick is to distinguish in the code between connecting and
logging in and use separate timeouts for each one.

We have nowhere to store a login timeout; we have only connect timeout and
query timeout (in TDSLOGIN).

I would keep connect timeout for connections, and initially set
query_timeout to be the login timeout. The login function could use that.
Then, after logging in, reset query_timeout to its original configured
value (taken from freetds.conf or the built-in 0).

Or something like that.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page