Re: tinytds based on freetds crashing
"James K. Lowden" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 5 Apr 2012 10:31:35 -0400 Ken Collins <[email protected]> wrote: > I found this link some time ago and have attached it to a few TinyTDS > issues regarding poor connections. > > http://blogs.msdn.com/b/sql_protocols/archive/2006/03/09/546852.aspx > > "It causes good connection to break during transient network > failures. So configuring the keep-alive values too small is not > recommended..." Google this term: Richard Stevens "make dead" get this URL: http://www.scribd.com/doc/7296598/Unix-Network-Programming-Volume-I-The-Sockets-Networking-API-3rd-Edition find on page 279: "The purpose of this option is to detect if the peer host crashes or becomes unreachable (e.g., dial-up modem connection drops, power fails, etc.). If the peer process crashes, its TCP will send a FIN across the connection, which we can easily detect with select in Section 6.4. (This was why we used select in Section 6.4.) Also realize that if there is no response to any of the keep-alive probes (scenario 3), we are not guaranteed that the peer host has crashed, and TCP may well terminate a valid connection. It could be that some intermediate router has crashed for 15 minutes, and that period of time just happens to completely overlap our host's 11-minute and 15-second keep-alive probe period. In fact, this function might more properly be called 'make-dead' rather than 'keep-alive' since it can terminate live connections. "This option is normally used by servers, although clients can also use the option. Servers use the option because they spend most of their time blocked waiting for input across the TCP connection,that is, waiting for a client request. But if the client host's connection drops, is powered off, or crashes, the server process will never know about it, and the server will continually wait for input that can never arrive. This is called a half-open connection . The keep-alive option will detect these half-open connections and terminate them." Whenever I hear "keep-alive" I think "make-dead". Ironically, it keeps Steven's alive to me. --jkl