1

I found this bug report. The question is, "Is that what's happening to me?".

I have a few situations where I do this sort of thing.

<cfthread name="thread1" action="run">
code for thread1
</cfthread>

<cfthread name="thread2" action="run">
code for thread2
</cfthread>

The next one will have an actual name.

<cfthread name="CIMSThread" action="run">
code for CIMSThread
</cfthread>

<cfthread name="thread1,thread2,CIMSThread" action="join"></cfthread>

Every so often, I will get these sorts of exceptions.

"Error","cfthread-638","04/10/13","15:14:14",,"CIMSTHREAD: null"
"Error","jrpp-1215","04/10/13","15:14:22","DWQueries","Error Executing Database 
Query.<br><b>Query Of Queries runtime error.</b><br>  
Table named CIMSThread.CIMSData was not found in memory.  etc"

When it first happened, I ran the applicable report again and got the same type of error on a different thead and eventually got it to run successfully without changing any code or data.

When it first happened, I also thought something bad might be happening in the thread which would cause it to crash, so I did something to force that to happen. However, when I checked the exception log, the error in that thread showed up. In these cases, the exception log shows what's in this post.

We are running Version 9,0,1,274733 and have monitoring turned on.

Am I being affected by the reported bug, or might this be something else?

Reply to Comments

I am not able to reproduce the problem at will. After consulting with my administrator we have turned off monitoring, but the pages are not being run very often. If the errors don't appear for awhile, it won't necessarily prove anything.

The problematic threads contain long running queries. Something I just thought of is that there is a very frequently used page that has never caused an issue. There are two differences between the good page and the problem pages. The good page has runs just two threads and joins them. The problem pages run more than two. Also, the queries on the good page don't take as long to exectute.

For Those Who Suggest A Timeout, It's Not

Here is some code. The query takes about 4 seconds to run.

<cfthread name="ThreadWithTimeOut" action="run">
<cfquery name="thread.x" datasource="dw" timeout="1">
sql deleted
</cfquery>
</cfthread>
<cfthread action="join" name="ThreadWithTimeOut"></cfthread>
<cfdump var="#ThreadWithTimeOut.x#" metainfo="no">

The exception log shows this:

"Error","cfthread-6","04/16/13","14:19:15",,"THREADWITHTIMEOUT: 
Error Executing Database Query. ** 
Error ** (11319) [Red Brick Warehouse JDBC Driver] : 
Query timeout (1 seconds) has expired."
coldfusion.tagext.sql.QueryTag$DatabaseQueryException: Error Executing Database Query.

and this:

"Error","jrpp-238","04/16/13","14:19:15","Dan",
"Element X is undefined in THREADWITHTIMEOUT.

That's a different set of exceptions. The previous ones said the thread was null.

Mike Causer
  • 8,196
  • 2
  • 43
  • 63
Dan Bracuk
  • 20,699
  • 4
  • 26
  • 43
  • It does look very similar. Are you able to create the issue at will? If so, does it go away when you turn monitoring off? – Miguel-F Apr 11 '13 at 17:46
  • It's difficult to comment, Dan, without seeing what you're doing with that variable in the thread code. I was not able to replicate that bug you mention. – Adam Cameron Apr 11 '13 at 18:57
  • Dan, I have not really used `cfthread` before so not too familiar with it. You stated that your queries take a while to run. Perhaps on occasion the query is actually timing out which is resulting in the query result not being available. Are you able to `cfdump` the error structure from the `cfthread` code? I guess you would need to write it to a file since there is no output buffer. The `cfdump` tag has an attribute to do that for you. See the 'output' attribute. If you can dump the entire error structure it may point you in the right direction. – Miguel-F Apr 16 '13 at 12:39
  • For reference - [Handling ColdFusion thread errors](http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0c09d-7feb.html#WSc3ff6d0ea77859461172e0811cbec22c24-7cc5) – Miguel-F Apr 16 '13 at 12:45
  • Dan, you have not shared the actual code so we are making some assumptions here. Does your join call have a timeout set or is it waiting indefinitely? If a preceding thread fails/errors does the next thread attempt to process anyway? Is your CIMSThread attempting to reference something from the other thread(s)? – Miguel-F Apr 16 '13 at 19:29
  • @Dan Bracuk FWIW, I've just stumbled onto this bug in CF2018 Update 4 with monitoring enabled, with a set of ``s where each thread calls an external web service and "returns" a query object. Exception log is littered with `java.lang.NullPointerException at coldfusion.monitor.util.ThreadMonitorData.(ThreadMonitorData.java:43)...etc`. Turning monitoring off resolves the error. – Juffy Jul 14 '20 at 04:51

1 Answers1

0

look at the error you're getting more closely:

"Error","cfthread-638","04/10/13","15:14:14",,"CIMSTHREAD: null"
"Error","jrpp-1215","04/10/13","15:14:22","DWQueries","Error Executing Database 
Query.<br><b>Query Of Queries runtime error.</b><br>  
Table named CIMSThread.CIMSData was not found in memory.  etc"

From that error I can only assume (because you didn't provide any actual code in your question) that the code in the CIMSTHREAD is raising an error causing the thread to crash and not return any data.

Also from the error (and your question), I can deduct that your thread is querying the database and passing it back.

Now personally I don't know why in the world you're using a thread to query your database. If you need to resort to that because the queries take awhile to execute, then you have bigger problems my friend. I would put the queries being run against the database in a ide attached to the database itself. See if you need to add an index or play with the query somehow so that it returns faster.

Bottom line... I think your problem isn't a cfthread issue, its a timeout issue with your query.

rip747
  • 9,375
  • 8
  • 36
  • 47
  • Thank you for your answer but it's not the case. If there was an error in the thread it would appear in the exception log, as mentioned in my post. – Dan Bracuk Apr 14 '13 at 14:00