Re: timeout handling and server msg callback

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4d5XnCzhh5o7epJhq7Xq7Lhtmdjz5fOugSOEp=O0K_F0Q@mail.gmail.com>
2014-10-30 4:10 GMT+00:00 Tolga Ceylan <[email protected]>:

> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.