Issues
- Timeout exception is not caught with cferrorLDEV-4311Michael Offner
- cftimeout testcase failed due to incorrect ExceptionLDEV-4215Resolved issue: LDEV-4215Pothys - MitrahSoft
- cfstoredproc timeout not working correctlyLDEV-4129Michael Offner
- Uploading large file throws timeoutLDEV-3741Resolved issue: LDEV-3741Pothys - MitrahSoft
- Regression - Request timeout error failed to throwLDEV-3733Resolved issue: LDEV-3733Michael Offner
- Transaction gets committed after getting interrupted by a request timeoutLDEV-3558Resolved issue: LDEV-3558Pothys - MitrahSoft
- add possibility to add a cpu/memory/concurrent request threshold for request timeoutLDEV-3019Resolved issue: LDEV-3019Michael Offner
- LONG execution and Duplicates, when mssql exceed request timeoutLDEV-2964Michael Offner
- onError fails on RequestTimeoutExceptionLDEV-2756Resolved issue: LDEV-2756
- Queries using queryExecute() that take longer than the request timeout results in hung threadLDEV-2591
- RequestTimeout=0 should DISABLE request timeouts, not set them very highLDEV-1913Resolved issue: LDEV-1913
- request timeout lead to zombie threads in servlet engineLDEV-1270Resolved issue: LDEV-1270Michael Offner
- SQL Queries Do Not Abide by RequestTimeout SettingLDEV-1067Michael Offner
- add attribute timeout to cfdbinfoLDEV-1033Michael Offner
- <cfquery> fails in custom error template without timeout attribute in case of an request time outLDEV-731Michael Offner
- add option to turn off the request timeout entirely for lucee core developmentLDEV-726
- Named lock does not throw on timeoutLDEV-594Michael Offner
- Errors/timeouts occur if using threads via the java concurrency framework (JCF)LDEV-579Michael Offner
- cfhttp (with updated library) timeout issueLDEV-485Resolved issue: LDEV-485Michael Offner
- timeout attribute does not support TimespanLDEV-435Resolved issue: LDEV-435Michael Offner
- cfhttp creates connections that don't expire until the keep-alive timeoutLDEV-371Resolved issue: LDEV-371Michael Offner
- RequestTimeout cripples 3 party codeLDEV-179Resolved issue: LDEV-179
Timeout exception is not caught with cferror
Description
Environment
OS : Windows Server 2019
Java Version : 11.0.15+10
Tomcat Version : Apache Tomcat/9.0.62
Lucee Version : 5.3.9.141
Microsoft JDBC Extension Version : 9.4.1
Attachments
Details
Assignee
Michael OffnerMichael OffnerReporter
HHPriority
NewNew 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
Sprint
Affects versions
Details
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
Sprint
Affects versions
Activity
Pete Freitag12 May 2023 at 19:35
@Zac Spitzer I am still encountering a case where getTimeoutStackTrace()
is null, and PageContextUtil.remainingTime()
is 0
. In this case if I cfinclude a error page in my onError, even when it is wrapped in a try / catch I cannot catch the exception. Here’s how to reproduce:
Application.cfc:
component {
onError(exception) {
try {
var timeLeft = createObject("java", "lucee.runtime.util.PageContextUtil").remainingTime(getPageContext(), false);
writeOutput("<p>Time Left: #timeLeft#</p>"); //0
writeDump(getPageContext().getTimeoutStackTrace()); //null
cfinclude(template="error-handler.cfm"); //causes the error dump, cannot catch it
} catch (any err) {
writeOutput("Include Error"); //never runs
}
}
}
test.cfm:
<cfsetting requesttimeout="1">
<cfset request.x = 1>
<cfset sleep(500)>
<cfset request.x = 2>
<cfset sleep(500)>
<cfset request.x = 3>
<cfset sleep(500)>
<cfset request.x = 4>
<cfset sleep(500)>
<cfset request.x = 5>
<cfinclude template="empty.cfm">
<cfset request.x = 6>
DONE!
error-handler.cfm:
<h2>Error Handler</h2>
<cfdump var="#exception#">
Run the page a few times, sometimes it will work (when getTimeoutStackTrace is not null) and sometimes it will not not (when it is null).
When it does not the output is:
Time Left: 0
getTimeoutStackTrace() == null
lucee.runtime.exp.RequestTimeoutException (lucee dumps the exception, not error-handler.cfm)
My workaround is going to be to use the timeLeft
variable and not include the error handler, but it would be nice if there were not uncatchable exceptions.
Zac Spitzer12 May 2023 at 06:48
@Pete Freitag nice digging! @Michael Offner has already changes the onError handler to not timeout https://luceeserver.atlassian.net/browse/LDEV-2756
Pete Freitag11 May 2023 at 19:59
Some additional info - also triggering this error when not using cferror, but just using a Error Template in the Lucee admin. Here’s how it happens:
Assume I have a query that hits the query timeout, and also the page timeout
Lucee or the DB driver throws a timeout exception
Lucee tries to include the global error template cfm file
When lucee tries to include the global error template it calls which makes a call to
_doInclude
inPageContextImpl
(https://github.com/lucee/Lucee/blob/5.3.10.97/core/src/main/java/lucee/runtime/PageContextImpl.java#L946)The first thing _doInclude() does is call
PageContextUtil.checkRequestTimeout(this);
since we are already over the page timeout this check fails and throws another exception.Thankfully this doesn’t cause an infinite loop, but does cause the dump to be shown.
I can also trigger this dump via a onError if I do a cfinclude to a error.cfm page. So to summarize this error can happen any one of three ways:
When a timeout occurs and cferror tries to include a cfm
When a timeout occurs and onError tries to cfinclude a cfm
When a timeout occurs and the global error handler cfm page (defined in lucee admin) is included
Pothys - MitrahSoft5 May 2023 at 07:15
I’ve checked this ticket with lucee version 5.3.10.120. When using the above code with cftry, I got the same "The query has timed out" error, Also without using cftry, it throws an "request [/.../LDEV4311/test.cfm (D:\projects\....\....\LDEV4311\test.cfm)] has run into a timeout (timeout: [1] seconds) and has been stopped . The thread started [1724] ms ago" error.
and checked the same with cftry in ACF and it returned "Request exceeded time limit allowed Tag: cfoutput" error. Without using cftry, it throws the error "Error Executing Database Query.[Macromedia][SQLServer JDBC Driver]Execution timeout expired".
@Michael Offner will confirm about this.
Zac Spitzer5 May 2023 at 07:11Edited
@Pete Freitag playing with this with step debugging, with a pause, cferror works, so as per the previous comments , I think this is indeed caused by https://github.com/lucee/Lucee/commit/788e0625db67b9d2a7b5c6f79cd068fe87bdc57f / https://luceeserver.atlassian.net/browse/LDEV-2332
Hi,
We have the following line in application.cfc in onRequestStart to redirect all uncaught errors to a custom error page:
<cferror type="EXCEPTION" template="error.cfm">
But after updating from Lucee version 5.3.2.77 to Lucee version 5.3.9.141 this does not seem to catch timeout exceptions:
Other errors do go through the error.cfm template.
I asked about this in Timeoute exception is not caught with cferror - dev / support - Lucee Dev. A workaround is using the onError function in application.cfc