timeout handling and server msg callback

Tolga Ceylan <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CALmu+SyZU3hALGkxEyjae3yb72X=eAS1t63aEx6B=F9Q+v1oKQ@mail.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
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.