tracker issue : CF-4126397

select a category, or use search below
(searches all categories and all time range)
Title:

Passing structs inside thread to cfhttp buggy - struct is modified

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Harry Klein / Harry Klein (Harry Klein)

Created: 03/09/2016

Components: Language

Versions: 2016

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: RC1_v12 /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win All

Vote Count: 0

Listed in the version 2016.0.01.298513 Issues Fixed doc
Verification notes: verified_fixed on July 30, 2017 using build 2016.0.01.298513
Problem Description:
Passed struct gets modified inside cfthread

Steps to Reproduce:

<cffunction name="post" hint="Does a asyncronous POST HTTP request" access="public" returntype="void" output="false">
	<cfargument name="url" hint="The url to do a post request on" type="string" required="Yes">
	<cfargument name="formdata" hint="Structure of form, value pairs" type="struct" required="no" default="#StructNew()#">

<cflog file="asynchttp1" text="#serializeJson(arguments.formdata)#">

	<cfthread name="asynchttp-thread-#createUUID()#" action="run" posturl="#arguments.url#" data="#arguments.formdata#" httpcookies="#stCookies#">
		<cfset var iItem = "">

<cflog file="asynchttp2" text="#serializeJson(attributes.data)#">

		<cfhttp url="#attributes.posturl#" method="post" timeout="1">
			<cfhttpparam type="formfield" name="callbackurl" value="#attributes.posturl#" />

<cflog file="asynchttp3" text="#serializeJson(attributes.data)#">

			<cfloop collection="#attributes.data#" item="iItem">
				<cfhttpparam type="formfield" name="#iItem#" value="#attributes.data[iItem]#" />
			</cfloop>


Actual Result:
Result from first logfile (asynchttp1.log)
"Information","http-nio-8500-exec-5","02/08/16","14:20:55","CONTENSTESTS","{""DELETESCHEDULEDTASK"":""contenstests-publishinstance-662""}"
"Information","http-nio-8500-exec-5","02/08/16","14:20:55","CONTENSTESTS","{""DELETESCHEDULEDTASK"":""contenstests-revokeinstance-662""}"
"Information","http-nio-8500-exec-5","02/08/16","14:20:55","CONTENSTESTS","{""DELETESCHEDULEDTASK"":""contenstests-deleteinstance-662""}"

Result from second logfile (asynchttp2.log)
"Information","cfthread-0","02/08/16","14:20:55","CONTENSTESTS","{""DELETESCHEDULEDTASK"":""contenstests-publishinstance-662""}"
"Information","cfthread-1","02/08/16","14:20:55","CONTENSTESTS","{""DELETESCHEDULEDTASK"":""contenstests-revokeinstance-662""}"
"Information","cfthread-3","02/08/16","14:20:55","CONTENSTESTS","{""DELETESCHEDULEDTASK"":""contenstests-deleteinstance-662""}"

Result from third logfile (asynchttp3.log)
"Information","cfthread-0","02/08/16","14:20:55","CONTENSTESTS","{""DELETESCHEDULEDTASK"":""contenstests-revokeinstance-662""}"
"Information","cfthread-3","02/08/16","14:20:55","CONTENSTESTS","{""DELETESCHEDULEDTASK"":""contenstests-deleteinstance-662""}"
"Information","cfthread-1","02/08/16","14:20:55","CONTENSTESTS","{""DELETESCHEDULEDTASK"":""contenstests-revokeinstance-662""}"

As you see the data changed - "revokeinstance"

Expected Result:
struct data should not change

Any Workarounds:
-

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4126397

External Customer Info:
External Company: CONTENS
External Customer Name: Harry Klein
External Customer Email: KLEIN@CONTENS.DE
External Test Config:  


Bug File Paths:
\\sjshare.corp.adobe.com\Prereleasebugfiles\ColdFusion\12.0\RC1_v12\4114981\testformatforlist.cfm

Attachments:

Comments:

Adding BUG AUDIT TRAIL ********action: updated fieldName: Changelist newValue: 298099 oldValue: Blank oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-02 07:34:05.0 action: updated fieldName: Status newValue: ToTest oldValue: ToFix oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-02 07:34:05.0 action: updated fieldName: Reason newValue: Fixed oldValue: BugVerified oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-02 07:34:05.0 action: updated fieldName: Owner newValue: suchsing oldValue: sanniset oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-02 07:34:05.0 action: updated fieldName: Fixed By newValue: sanniset oldValue: Blank oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-02 07:34:05.0 action: updated fieldName: Date Fixed newValue: 2016-03-01 23:34:05.0 oldValue: Blank oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-02 07:34:05.0 action: updated fieldName: Dev Assigned newValue: sanniset oldValue: awdhesh oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-12 10:53:34.0 action: updated fieldName: Owner newValue: sanniset oldValue: awdhesh oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-12 10:53:34.0 action: updated fieldName: Fix By Product Milestone newValue: HF1 oldValue: Alpha oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-12 10:52:45.0 action: updated fieldName: Fix By Milestone newValue: Post Release oldValue: Alpha oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-12 10:52:45.0 action: updated fieldName: Priority newValue: 3 oldValue: 0 oprid: hkallae recordName: RQ_DEFECT timpestamp: 2016-02-12 05:58:46.0 action: updated fieldName: Reason newValue: BugVerified oldValue: PRHaveInfo oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-11 11:07:02.0 action: updated fieldName: Owner newValue: awdhesh oldValue: suchsing oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-11 11:07:02.0 action: updated fieldName: Status newValue: ToFix oldValue: ToTrack oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-11 11:07:02.0 action: updated fieldName: Reason newValue: PRHaveInfo oldValue: PRNeedInfo oprid: prerelease recordName: RQ_DEFECT timpestamp: 2016-02-09 09:48:46.0 action: updated fieldName: Status newValue: ToTrack oldValue: ToTrack oprid: prerelease recordName: RQ_DEFECT timpestamp: 2016-02-09 09:48:46.0 action: updated fieldName: State newValue: Open oldValue: Open oprid: prerelease recordName: RQ_DEFECT timpestamp: 2016-02-09 09:48:46.0 action: updated fieldName: Reason newValue: PRNeedInfo oldValue: Blank oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-09 09:28:15.0 action: updated fieldName: Fix By Milestone newValue: Alpha oldValue: Blank oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-09 09:28:15.0 action: updated fieldName: Status newValue: ToTrack oldValue: Unverified oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-09 09:28:15.0 action: updated fieldName: Fix By Product Milestone newValue: Alpha oldValue: Blank oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-09 09:28:15.0 action: updated fieldName: Owner newValue: suchsing oldValue: inoel oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-08 13:57:33.0 action: updated fieldName: QE Assigned newValue: suchsing oldValue: inoel oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-08 13:57:33.0
Comment by CFwatson U.
4264 | March 09, 2016 01:56:14 AM GMT
Added By: PreRelease User User Name:Harry Klein Note Added: This issue can be closed Date Added :2016-02-26 11:24:57.0 Added By: PreRelease User User Name:Harry Klein Note Added: I modified the code in our CMS, the workaround works - please close this issue. Date Added :2016-02-11 09:19:11.0 Added By: PreRelease User User Name:Harry Klein Note Added: Please move the testfile to issue CF-4114475, Thanks Date Added :2016-02-11 09:16:50.0 Added By: PreRelease User User Name:Harry Klein Note Added: Sorry, this was a testfile for another issue (casting problems) Date Added :2016-02-11 09:15:22.0 Added By: PreRelease User User Name:Harry Klein Note Added: I managed to create a testfile where you can reproduce the problem! See attached file "testformatforlist.cfm" Date Added :2016-02-11 09:13:35.0 Added By: PreRelease User User Name:Harry Klein Note Added: Sorry, I tried it but it takes to long to create an isolated testfile. I could show you the problem via Teamviewer? Date Added :2016-02-09 09:48:45.0 Added By:suchsing Note Added: Tried the following code but could not repro it. <cffunction name="post" hint="Does a asyncronous POST HTTP request" access="public" returntype="void" output="false"> <cfargument name="url" hint="The url to do a post request on" type="string" required="Yes"> <cfargument name="formdata" hint="Structure of form, value pairs" type="struct" required="no" default="#StructNew()#"> <cflog file="asynchttp1" text="#serializeJson(arguments.formdata)#"> <cfthread name="asynchttp-thread-#createUUID()#" action="run" posturl="#arguments.url#" data="#arguments.formdata#"> <cfset var iItem = ""> <cflog file="asynchttp2" text="#serializeJson(attributes.data)#"> <cfhttp url="#attributes.posturl#" method="post" timeout="1"> <cfhttpparam type="formfield" name="callbackurl" value="#attributes.posturl#" /> </cfhttp> <cflog file="asynchttp3" text="#serializeJson(attributes.data)#"> <cfhttp url="#attributes.posturl#" method="post" timeout="1"> <cfloop collection="#attributes.data#" item="iItem"> <cfhttpparam type="formfield" name="#iItem#" value="#attributes.data[iItem]#" /> </cfloop> </cfhttp> </cfthread> </cffunction> <cfset post("http://petstore.swagger.io/v2/pet",{ "id": 75, "name": "a", "photoUrls": [], "tags": [], "status": "available" })> Can you give us a simple snippet that could help us to repro it? Thanks, Suchika. Date Added :2016-02-09 09:28:19.0 Added By: PreRelease User User Name:Harry Klein Note Added: Entered Bug. Date Added :2016-02-08 13:25:15.0
Comment by CFwatson U.
4265 | March 09, 2016 01:56:15 AM GMT
Verified, on April 12, 2016, that this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
4266 | July 30, 2017 06:21:05 PM GMT