Kill long running query (cfquery-timeout / requesttimeout / cfthread-timeout do not work!)

134 views
Skip to first unread message

Andy Bellenie (cfwheels)

unread,
Sep 26, 2013, 8:49:23 AM9/26/13
to ra...@googlegroups.com
Running Railo 4.0.5.004 on Windows 2012 with MS-SQL 2012.

I am trying to gracefully kill a long running query as a fail safe mechanism, but nothing I try seems to work.

I am using the JTDS driver.

The simplest solution should be the timeout attribute on cfquery.

Running this code works fine

<cfquery name="example1" datasource="xxx" timeout="1">
SELECT TOP 1 * FROM contacts
WAITFOR DELAY '00:00:10'
</cfquery>

However if I remove the TOP 1 and return all rows (there's a few million in the table) the query continues running and ignores the timeout value until it has completed.

I have the same issue when using requesttimeout or even running the query in a separate thread and placing a timeout on that. Once the query is returning rows it seems unstoppable and the thread unkillable.

Can anyone shed any light on this behaviour?

Thanks in advance
Andy



Jean Moniatte

unread,
Sep 26, 2013, 8:52:24 AM9/26/13
to Railo Google Group
Hello,

maybe use a query that returns less than a few million rows ?

Thanks,
Jean
--
Jean Moniatte
UGAL



--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/1ef7531b-052c-4669-8737-1141376f8f47%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Andy Bellenie (cfwheels)

unread,
Sep 26, 2013, 8:55:50 AM9/26/13
to ra...@googlegroups.com
That query was just an example to demonstrate the problem. 

Jean Moniatte

unread,
Sep 26, 2013, 9:10:15 AM9/26/13
to Railo Google Group
Maybe it means that the timeout does not take into account the time needed to stream all the data back from the database?

Are you sure that the query takes more time to run than your timeout?

Thanks,
Jean
--
Jean Moniatte
UGAL

--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.

Andy Bellenie (cfwheels)

unread,
Sep 26, 2013, 10:33:47 AM9/26/13
to ra...@googlegroups.com
Well, the Railo debug reports that the query takes 12 seconds to run, and I've also performed a very unscientific count in my own head.


On Thursday, 26 September 2013 13:49:23 UTC+1, Andy Bellenie (cfwheels) wrote:
Reply all
Reply to author
Forward
0 new messages