Skip to Content.
Sympa Menu

freetds - Re: [freetds] timeout handling and server msg callback

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] timeout handling and server msg callback
  • Date: Thu, 30 Oct 2014 10:02:50 +0000

2014-10-30 4:10 GMT+00:00 Tolga Ceylan <tolga.ceylan AT gmail.com>:

> Hi All,
>
> Recently, I've stumbled on a potential issue with the timeout handling
> in ct_lib.
>
> Given these two cases of SQL executing;
>
> DECLARE @counter int
> WHILE (@counter < 99999999)
> BEGIN
> PRINT @counter
> SET @counter = @counter + 1
> END
>
> versus;
>
> DECLARE @counter int
> WHILE (@counter < 99999999)
> BEGIN
> SET @counter = @counter + 1
> END
>
> (only difference is print or no-print basically)
>
> seems to affect timeout handling since this trips the ::select() (aka
> tds_select) based query timeout.
>
> In other words, continuously feeding such server messages back to the
> client bypasses
> the query timeout. The issue is tricky because there has to be enough
> 'print' executions
> to actually trigger this. (Probably due to Nagle or other buffering.)
>
> Has anybody seen this before? Any work around for it(*) ?
>
> (*) the fix probably is to consider beginning/end of the actual
> queries as opposed to blocking on select
> with query timeout.
>
> I'm using 0.82 on linux centos 6.5 although I couldn't see changes
> related to this in 0.91.
>
> Cheers,
> Tolga
>


Hi,
It's not a bug, it's a feature :)

Really, this is the intention. Also considering that you should handle
results (print IS a result) the library should return so your timeout
should be managed by application.

Frediano




Archive powered by MHonArc 2.6.24.

Top of Page