Timeouts

Hello,

I’m seeing what I think is incorrect behavior with timeouts:

First, start server process with 1-second timeout, and create a test table for querying:

j@m5:~$ q -T 1 -p 5000
KDB+ 3.1 2014.07.01 Copyright (C) 1993-2014 Kx Systems
l32/ 4()core 15748MB j m5 127.0.1.1 NONEXPIRE 

q)t:(x:til 100000000)

Then, create a client process and run some queries against the server above:

KDB+ 3.1 2014.07.01 Copyright (C) 1993-2014 Kx Systems
l32/ 4()core 15748MB j m5 127.0.1.1 NONEXPIRE 

q)h:hopen::5000 q)\t h"select log x from t;"  / query is interrupted as expected 'stop q)\t @[h;"select log x from t;";]  / but it still exceeds timeout threshold
3458

Also, update queries don’t seem to time out at all, regardless of timeout.  Continuing the client session above:

q)\t h"update x:log x from t;"
3509

Nor do other, non-select statements time out, e.g.:

q)\t h"log t`x;"
3399

I’m not sure whether the last is erroneous or not - the command line reference mentions that the timeout applies to “client queries”, but the \T reference says “client call”.

Hi John,
The timeout setting can be circumvented in some occasions.

From Charlie

“The timeout (and also interruption via ctrl-c) areimplemented via the setting of a flag which is polled at certain points ofexecution (e.g. function exit), where early return is manageable and theoverhead of polling does not impact performance significantly.”

So therefore certain scenarios can cause the execution to complete before the flag is checked.

Thanks Rory