Skip to Content.
Sympa Menu

freetds - Re: [freetds] How to cancel ct_results ?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: jarek AT poczta.srv.pl
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] How to cancel ct_results ?
  • Date: Wed, 16 Sep 2009 16:16:52 +0200

Hi!

Cytowanie "James K. Lowden" <jklowden AT freetds.org>:

Jarek wrote:
when connection to database
is lost just before call to ct_results, my application hangs. It looks
that ct_results doesn't return in such case.

It might be the case. Timeout logic is tricky, and no one has done much
with the ct-lib code since I re-wrote the libtds layer to correctly handle
timeouts (for the first time) in db-lib. What ct-lib needs is someone
with interest and knowledge to apply himself to the problem.

After some debugging, I've found that the problem comes from gnutls_record_recv.
There are few solutions:
1. Change the socket to non-blocking, but this probably need some changes also in other places where this socket is used.
2. Add select with timeout before socket read/write.
3. Send some signal or close socket from parallel thread after timeout (I'm not sure if it will help).

I'm ready to write this code, but I'd like to know which solution will be the best. I hope this code can be added to future releases of freetds.

Best regards
Jarek

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




Archive powered by MHonArc 2.6.24.

Top of Page