Details
Details
Assignee
Unassigned
UnassignedReporter
JP
JPLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Priority
Created 21 December 2017 at 18:20
Updated 8 May 2020 at 18:11
Setting a query timeout is considered good practice to prevent DoS attacks, and in general can protect your app from hanging threads when a query does not return. I believe this has been supported in ACF since CF9, and is specified in the datasource settings.
Currently in Lucee, there is no way to specify a query timeout value on a per-datasource level, and is only partially possible on a per-application level. The only thing that comes close would be to add: this.tag.query.timeout = 60; to application.cfc, but this setting is ignored when calling queryExecute().
Ideally, you should be able to do both. One use-case that's interesting for setting it on a per-datasource level is when you setup two separate datasources that point to the same database, each with a different query timeout setting... the DSN with a longer timeout is used for admin/reporting features that have heavier queries, and the other is used for end users.
Here's an article that was written a long time ago, but is still relevant. http://www.carehart.org/blog/client/index.cfm/2010/7/14/hidden_gem_in_cf9_admin_querytimeout
In it, Charlie points out:
This is exactly the issue I'm currently experiencing with an mssql datasource. I've get hanging threads that are waiting for a query to finish executing. The requests never timeout even though my application timeout is set to 50 seconds. I'm seeing that some queries get "suspended" and are waiting for a resource to become available, which in some cases never happens. See my bug report here: https://luceeserver.atlassian.net/browse/LDEV-1622