dswitzer
09/14/2023, 1:45 PMzackster
09/14/2023, 1:51 PMdswitzer
09/14/2023, 1:52 PM<cfsetting requesttimeout="5" />
<cfloop index="idx" from="1" to="100">
<div><cfoutput>#idx#</cfoutput></div>
<cfset sleep(1000) />
</cfloop>
When this runs, I see the expected Lucee error screen. It also doesn't show up in Tomcat's catalina.log file.
My second script looks like this:
<cfsetting requesttimeout="5" />
<cfscript>
test = queryExecute("WAITFOR DELAY '00:00:45'; select 'finished delay of 00:00:45' as [response]");
dump(test);
</cfscript>
This ends up sending the exeception to the catalina.log file and I get no output.dswitzer
09/14/2023, 1:54 PMcomponent {
/*
Configure database properties
*/
variables.dbHost = "";
variables.dbPort = 1433;
variables.dbName = "";
variables.dbUsername = "";
variables.dbPassword = "";
variables.socketTimeout = 15000; // in milliseconds
variables.queryTimeout = 10; // in seconds
this.datasources["sql-server"] = {
class: "com.microsoft.sqlserver.jdbc.SQLServerDriver",
bundleName: "org.lucee.mssql",
bundleVersion: "12.2.0.jre11",
connectionString: "jdbc:sqlserver://#variables.dbHost#:#variables.dbPort#;UseUnicode=false;CharacterEncoding=false;ZeroDateTimeBehavior=false;TinyInt1isBit=false;databaseName=#variables.dbName#;SendStringParametersAsUnicode=false;AutoReconnect=false;DatetimeParameterType=datetime;Encrypt=false;JdbcCompliantTruncation=false;UseOldAliasMetadataBehavior=false;AllowMultiQueries=true;UseLegacyDatetimeCode=false;SelectMethod=direct;socketTimeout=#variables.socketTimeout#;queryTimeout=#variables.queryTimeout#",
username: variables.dbUsername,
password: variables.dbPassword,
// optional settings
connectionLimit:-1, // default:-1
LiveTimeout:15, // default: -1; unit: minutes
validate:false, // default: false
};
this.datasource = "sql-server";
}
So the query is timing out after 10 seconds and that's when I see the request die, but Tomcat isn't handling things the same way as the first request.dswitzer
09/14/2023, 1:56 PMzackster
09/14/2023, 1:57 PMczeller
09/14/2023, 2:41 PMdswitzer
09/14/2023, 2:50 PMdswitzer
09/14/2023, 3:08 PMcatalina.2023-09-14.log is the clue I need:
14-Sep-2023 15:06:57.928 SEVERE [http-nio-8080-exec-10] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [CFMLServlet] in context with path [] threw exception [null] with root cause
java.lang.ThreadDeath
at java.base/java.lang.Thread.stop(Thread.java:937)
at lucee.commons.io.SystemUtil._stop(SystemUtil.java:1343)
at lucee.commons.io.SystemUtil.stop(SystemUtil.java:1334)
at lucee.commons.io.StopThread.run(SystemUtil.java:1765)zackster
09/14/2023, 3:10 PMdswitzer
09/14/2023, 3:10 PMdswitzer
09/14/2023, 3:12 PM<cfsetting requesttimeout="XX" /> line is larger than the JDBC timeout, the page returns as expected. It's only when the value is smaller than the JDBC timeout does Tomcat/Lucee have issues.dswitzer
09/14/2023, 3:14 PMrequesttimeout is triggering the end of the request. It's also weird that it only does it with the JDBC example.czeller
09/14/2023, 3:16 PMdswitzer
09/14/2023, 3:16 PMdswitzer
09/14/2023, 3:27 PMsetting requestTimeout="5"; line, CFHTTP will use that timeout value over the manually specifed timeout in the CFHTTP call. It ends up not being a very equal test because of that.czeller
09/14/2023, 3:29 PMdswitzer
09/14/2023, 3:33 PMzackster
09/14/2023, 3:42 PMzackster
09/14/2023, 3:42 PMdswitzer
09/14/2023, 3:44 PM14-Sep-2023 15:12:38.832 SEVERE [http-nio-8080-exec-7] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [CFMLServlet] in context with path [] threw exception [null] with root cause
java.lang.ThreadDeath
at java.base/java.lang.Thread.stop(Thread.java:937)
at lucee.commons.io.SystemUtil._stop(SystemUtil.java:1343)
at lucee.commons.io.SystemUtil.stop(SystemUtil.java:1334)
at lucee.commons.io.StopThread.run(SystemUtil.java:1765)
e.PageContextImpl._doInclude(PageContextImpl.java:948)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:219)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2493)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2478)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2449)
at lucee.runtime.engine.Request.exe(Request.java:45)
That seems to be the problem.dswitzer
09/14/2023, 3:46 PMbdw429s
09/14/2023, 4:40 PMbdw429s
09/14/2023, 4:40 PMbdw429s
09/14/2023, 4:41 PMdswitzer
09/14/2023, 4:41 PMdswitzer
09/14/2023, 4:42 PMbdw429s
09/14/2023, 4:42 PMbdw429s
09/14/2023, 4:43 PMdswitzer
09/14/2023, 4:43 PMbdw429s
09/14/2023, 4:43 PMdswitzer
09/14/2023, 4:43 PMdswitzer
09/14/2023, 4:45 PMbdw429s
09/14/2023, 4:46 PMdswitzer
09/14/2023, 4:46 PMdswitzer
09/14/2023, 4:46 PMdswitzer
09/14/2023, 4:47 PMbdw429s
09/14/2023, 4:48 PMdswitzer
09/14/2023, 4:48 PMdswitzer
09/14/2023, 4:49 PMsetting requesttimeout=30 then it all works as you'd expected.dswitzer
09/14/2023, 4:49 PMbdw429s
09/14/2023, 4:50 PMbdw429s
09/14/2023, 4:51 PMdswitzer
09/14/2023, 4:51 PMbdw429s
09/14/2023, 4:52 PMdswitzer
09/14/2023, 4:52 PMbdw429s
09/14/2023, 4:53 PMdswitzer
09/14/2023, 4:55 PMdswitzer
09/14/2023, 4:57 PMdswitzer
09/14/2023, 4:57 PMbdw429s
09/14/2023, 4:59 PMdswitzer
09/14/2023, 5:00 PMdswitzer
09/14/2023, 5:03 PMdswitzer
09/14/2023, 6:34 PM