[freetds] cancel and timeout

Thompson, Bill D (London) bill_d_thompson at ml.com
Thu Jan 20 12:11:12 EST 2005


Freddy,

> Timeout
> -------
> Now if a timeout (now query_timeout) a query_timeout_func it's called.
I
> removed chkintr and hndlintr (one function it's sufficient).
> query_start_time it's use for global time counting. I don't know if
> query timeout on dblib works as expected. Perhaps even SQLFetch or
> similar need setting timeout.

I think there are two functions because this then mirrors the dblibrary
interrupt handlers.

Bill


-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of ZIGLIO,
Frediano, VF-IT
Sent: 20 January 2005 16:30
To: FreeTDS Development Group
Subject: [freetds] cancel and timeout


Well.. I did a big job on these stuff today... they just works (although
not perfectly).

Cancellation
------------

Added a TDS_READING state, now we have
TDS_DEAD connection broken, no read or send from server
TDS_IDLE client did not send data and we are no waiting data from server
TDS_QUERYING we are sending data to server
TDS_PENDING we are expecting data from server
TDS_READING we are reading data from server
As you can see TDS_READING and TDS_PENDING seems quite similar however
when you are in tds_process_results_tokens or similar state it's
TDS_READING while from outside we are in TDS_PENDING. This it's the key
of cancel fix. If we issue a cancel while another function it's reading
data we just set a in_cancel flag in TDSSOCKET and
tds_process_results_tokens function detect and handle cancellation by
itself. If we are in pending we can process cancel from server
(tds_process_cancel). The key now it's tds_set_state, to fix even thread
problem (like SQLCancel from another thread) a syncronization should
occur).
Asyncronous calls (signals) works as expected. 
TODO:
  better tds_process_cancel
  fix odbc using TDS_INT_CANCEL instead of TDS_INT_CONTINUE and
SQLCancel
  do not take into account in_cancel if we can return a correct result??

Timeout
-------
Now if a timeout (now query_timeout) a query_timeout_func it's called. I
removed chkintr and hndlintr (one function it's sufficient).
query_start_time it's use for global time counting. I don't know if
query timeout on dblib works as expected. Perhaps even SQLFetch or
similar need setting timeout.

... 

freddy77
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds 
--------------------------------------------------------
 
If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail.     http://www.ml.com/email_terms/ 
--------------------------------------------------------
 



More information about the FreeTDS mailing list