Title:
Implicit Scope causes thread termination at coldfusion.monitor.event.RequestMonitorEventProcessor.onThreadEnd
| View in TrackerStatus/Resolution/Reason: To Track//PRNeedInfo
Reporter/Name(from Bugbase): Jon C. / ()
Created: 03/26/2020
Components: Language
Versions: 2018
Failure Type: Data Corruption
Found In Build/Fixed In Build: 2018.0.08+318307 /
Priority/Frequency: Normal / Some users will encounter
Locale/System: English / Unix All
Vote Count: 3
Problem Description:
When using implicit scopes within a thread, all code within the thread completes, but the thread shows a status of terminated, with the following stack trace:
java.lang.NullPointerException at coldfusion.monitor.event.RequestMonitorEventProcessor.onThreadEnd(RequestMonitorEventProcessor.java:278) at coldfusion.thread.Task.fireThreadEndEvent(Task.java:220) at coldfusion.thread.Task.run(Task.java:170) at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:260) at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)
No other information is provided in the thread error object, other than a message of java.lang.NullPointerException
As such, it is impossible to validate the completion of the thread, even though all code within the thread tag has been executed without error
Steps to Reproduce:
Add the following within onRequestStart in Application.cfc:
request.foo = {};
var threadNames = [];
for( var i=1; i<=5; i++){
var threadName = "test_thread_"&i;
thread
name="#threadName#"
action="run"
threadName=threadName
{
request.foo[ threadName ] = {
"variables" : variables,
"request" : request,
"application" : application
};
}
threadNames.append( threadName );
}
thread action="join" name="#threadNames.toList()#";
for( var threadName in threadNames ){
writeDump( var=cfthread[ threadName ] );
}
abort;
Actual Result:
All threads show status as "TERMINATED" with the error above. A dump of `request.foo.keyArray()` shows that all items were successfully appended.
Expected Result:
All thread should show a status of "COMPLETE"
Any Workarounds:
None known
Attachments:
Comments: