'The key [STATUSCODE] does not exist' errors occurs under load, but not on Adobe ColdFusion 18

Description

When load testing our Soap Service Lucee Server (for our Lucee Migration) we consistently experience an error 'The key [STATUSCODE] does not exist' each time we run our jmeter load testing script.

The error occurs on the following call (a store procedure call to our sql server 2019):

<cfstoredproc procedure="checkCredits" returncode="yes" datasource="#{our database}#"> <cfprocparam type="in" dbvarname="@{a parameter}" value="#{an argument}#" cfsqltype="CF_SQL_VARCHAR"> ... </cfstoredproc> <!--- Error Occurs here ---> <cfset credits=cfstoredproc.StatusCode>

With Adobe ColdFusion 18 under the same/more load we don't experience this error.

What we know is:

  • Even though there is no limit to the concurrent database connections count on both our ACF and Lucee Servers, but limit to active clients per sql database table, only Lucee is erroring.

  • Our Stored Procedure takes some time to process each query, I would say possibly up to 2 seconds, the SP read and/or writes to multiple tables.

My theory is:

  • Their seems to be a deadlock on the sql server side when there is too many simultaneous update/insert attempts to a single table, the sql server rejects connections or they timeout resulting in the error we experience.

Could this error be caused by the Lucee tomcat connection pool being larger than the Coldfusion one. e.g. if ACF has cap of something like 100 concurrent requests (the rest are queues) but Lucee has a higher cap, so as each request is being simultaneously processed the sql server connection limits will be exceeds on Lucee but not on ACF?

Environment

None

Activity

Pothys - MitrahSoft 
16 November 2021 at 12:12

Did you see the above Brad's and zac's comments? and issue solved for you? Shall I close this ticket?

Zac Spitzer 
5 August 2021 at 09:21

you could

  1. add before the cfstoredproc call local.cfstoredproc=”” or var cfstoredproc;

  2. or use localmode=true for the function (which does the same)

Brad Wood 
4 August 2021 at 21:25

I gave you the solution above. Use the result attribute. I don’t understand why you’re coming up with crazy ideas like single threading your code with cflocks when the answer is in front of you.

This has always been the solution for ANY CFML tag that needs to be thread safe. Same with CFHTTP, CFQUERY, etc, etc. Adobe may have changed something to start putting them in a local scope by default, I’m not sure. But like I said above, just because it doesn’t error in Adobes doesn’t mean it’s working. You may still be accessing the variable in the variables scope but the key just never doesn’t exist.

Also, cfstoredproc is not a “scope”, it’s just a variable. Which in Lucee, is in the variables scope. It’s variables.cfstoredproc and therefore global to the CFC.

Just do:

<cfstoredproc result="local.cfstoredproc"...>

and you won’t even need to update the rest of your code.

Brad Wood 
4 August 2021 at 20:28

If this code is inside a CFC that is a singleton, I assume you have a var scoping issue as the “cfstoredproc” variable would be in the variables scope and thus shared by all threads. You need to use the “result” attribute to put the results in a local variable.

As to why it doesn’t error on Adobe, you probably just are getting lucky. I assume it’s not functioning as you expected in either case.

Won't Do

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 August 2021 at 20:24
Updated 8 November 2022 at 18:40
Resolved 8 November 2022 at 18:40