Skip to Content.
Sympa Menu

freetds - Re: Timeouts

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Jon Pounder <pounder AT inline.net>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Timeouts
  • Date: Fri, 23 Jun 2000 12:41:20 -0400


Hi,

I have not been able to reach Jeff myself in a while, so I'll answer.

Yes in general, when any sort of timeout occurs the odbc layer would return
an error, so other than getting more error details from the odbc layer, the
application would presumably close the socket connection shortly thereafter
without attempting any more reads. So as far as I see it the timeout
occuring mid packet would corrupt the stream, but likely it occurred in the
first place since there was a network problem already (assuming timeouts
are set to realistic values). Then when the application closes the
connection no further reads on the corrupted stream would occur after that.

Does this make sense ?



At 08:33 AM 6/23/00 -0400, you wrote:
>
>As mentioned before, I have been in the process of imlementing cancels
>in the TDS layer. As part of this effort I had to re-implement most
>of the network calls (I actually implemented a little network layer).
>Everything is working dandy except that I a trying to roll the
>timeout changes back in that were made by Jeff (the comments don't say
>Jeff's last name or e-mail address).
>
>While I am doing it I discovered something that concerns me.
>
>It looks like the way the timeouts work is that if tds->timeout
>is set, then any call to read or write to the network (all calls
>to tds_read_packet() or tds_write_packet()) will return if
>tds->timeout seconds has expired without reading an entire packet.
>
>The problem is that if the timeout period is reached while in
>the middle of reading a packet--which is unlikely but possible,
>the packet stream is then effectively corrupted. The next call
>to tds_net_read() will read the first 8 bytes off the network
>thinking that it is a packet header when it is really the
>last half of the last packet.
>
>So, in either case, timeouts are likely to break things.
>
>Also, if the timeout period is reached and no bytes have been
>read yet, all calls to tds_get_<datatype> will return 0, which
>will screw up the parsing of the TDS stream.
>
>So, my question: what are timeouts _supposed_ to do? I suspect
>that they are intended to cancel the current operation, but I
>am not sure.
>
>-scott
>
>--
>Scott C. Gray <gray AT voicenet.com> "my keybard is brken"
> http://www.voicenet.com/~gray/sqsh.html
>
>
>---
>You are currently subscribed to freetds as: pounder AT inline.net
>To unsubscribe, forward this message to
$subst('Email.Unsub')
>
>

Jon Pounder, Development Engineer
Inline Internet Systems
pounder AT inline.net Jon AT Pounder.com

Web Tools Engineered for Success
http://www.inline.net
http://www.ihtml.com






Archive powered by MHonArc 2.6.24.

Top of Page