[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetds
Subject:    Re: [freetds] Connection timeout
From:       "James K. Lowden" <jklowden () freetds ! org>
Date:       2008-07-10 15:47:12
Message-ID: 20080710114712.2295aa8a.jklowden () freetds ! org
[Download RAW message or body]

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
_______________________________________________
FreeTDS mailing list
FreeTDS@lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic