<cfquery> fails in custom error template without timeout attribute in case of an request time out

Description

The problem only occurs if a custom error - template is executed because of a request timeout and a < cfquery > tag without timeout attribute is executed within the custom error - template.

With the solution of LDEV-479, the timeout attribute for the tag is automatically set to the remaining request time if not specified by the tag itself . In the case of a request timeout, the internal check resolves to true, and a new "RequestTimeoutException" is thrown. As we already reached RequestTimeOut, this generated error cannot be caught with a try / catch.

Query.java , Line 467-469 ; LDEV-479

+ this.timeout=PageContextUtil.remainingTime(pageContext); + if(this.timeout.getSeconds()<=0) + throw new RequestTimeoutException("request timeout occured!");

There are two possible workarounds:

a) in the custom error - template, at the beginning, do something like this:

<cfsetting requestTimeout = " #getPageContext().getRequestTimeout()*2# " / >

b) add "timeout" attribute to the query tag:

<cfquery name="foo" timeout="20" ... >

The documentation of <cfquery> does not document and explain the scope and consequences of the change and even more worse: an existing application now can show the well known "last exit" error screen (in case of a request timeout), depending on the admin setting "Settings –> Error -> Status code". And this error screen is confusing, as it does not show the real source of the problem.

This also applies to <cfhttp>.

Environment

Performance/Language
Inspect Templates (CFM/CFC) Once ( Good )
Null Support Partial Support (CFML Default)
Dot notation Convert to upper case (CFML Default)
Local scope mode Classic (CFML Default)
Full utf-8 support

General Info
Version Lucee 4.5.2.018 final
Version Name Neo
Release date 04.11.2015
ColdFusion® compatibilty version 10.0.0.0

OS / Java
OS Windows Server 2012 (6.2) 64bit
Servlet Container Apache Tomcat/8.0.24
Java 1.8.0_45 (Oracle Corporation) 64bit
Architecture 64bit

Activity

Show:

Details

Assignee

Reporter

Priority

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

Created 4 February 2016 at 13:17
Updated 19 May 2021 at 11:40

Flag notifications