Title:
CFThread fails when called from Custom Tags without joining back to parent process
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Daniel Short / Daniel Short (Daniel Short)
Created: 06/19/2012
Versions: 10.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: Final / 282610
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Win 2008 Server R2 64 bit
Vote Count: 2
Problem Description:
When a cfthread tag is used inside a custom tag, if the thread is not joined back to the calling custom tag, then the thread does not property execute.
Steps to Reproduce:
Create the following three files, all in the same directory.
Application.cfc:
component
{
this.name = "CFThreadCustomTagTest";
}
ThePage.cfm:
<cfthread action="run" name="ThreadTestInPage">
<cflog log="Application" text="The thread in the page successfully ran" type="information" />
</cfthread>
<cf_ThreadTag />
ThreadTag.cfm:
<cfif thisTag.ExecutionMode EQ "start">
<cfthread action="run" name="ThreadTest">
<cflog log="Application" text="The thread within the tag successfully ran" type="information" />
</cfthread>
</cfif>
Actual Result:
When viewing the logs, I see the following entries:
"Severity","ThreadID","Date","Time","Application","Message"
"Information","ajp-bio-8012-exec-1","06/19/12","07:18:11",,"C:\ColdFusion10\cfusion\logs\application.log initialized"
"Information","cfthread-11","06/19/12","07:18:15","CFTHREADCUSTOMTAGTEST","The thread in the page successfully ran"
"Error","cfthread-9","06/19/12","07:18:15",,"THREADTEST: Variable _cffunccfthread_cfThreadTag2ecfm16902001291 is undefined. "
Expected Result:
I expect to see two log entries, one for the thread processing in the page, and one for the thread processing in the tag.
Any Workarounds:
If I change ThreadTag.cfm to the following code:
<cfif thisTag.ExecutionMode EQ "start">
<cfthread action="run" name="ThreadTest">
<cflog log="Application" text="The thread within the tag successfully ran" type="information" />
</cfthread>
<cfthread action="join" name="ThreadTest" timeout="10" />
<cfdump var="#cfthread#">
</cfif>
Then I get the two log entries that I expect. However, I need to be able to run a thread without waiting for it to finish.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3218452
Keywords:
FixTested
External Customer Info:
External Company:
External Customer Name: webshorts
External Customer Email:
External Test Config: My Hardware and Environment details:
Windows Server 2008, IIS 7 using the default ColdFusion 10 install. I have updated the JVM to u32 in order to be compatible with Microsoft's JDBC SQL Server driver. You can see my development server settings here:
https://dl.dropbox.com/u/2586403/serversettings.pdf
I see this on three separate ColdFusion 10 installations, and can reproduce the problem every single time.
Attachments:
Comments: