tracker issue : CF-4204404

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

App-specific mappings do not register correctly

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Jason F. / ()

Created: 05/21/2019

Components: Framework

Versions: 2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2018,0,03,314033 / latest build

Priority/Frequency: Normal / Most users will encounter

Locale/System: English / Windows 10 64 bit

Vote Count: 3

Problem Description: Frameworks such as ColdBox use mappings to allow for portable modules. In ColdFusion 2018, application-specific mappings do not register correctly until an additional getApplicationMetadata() is called.

Steps to Reproduce:
Create a folder at the web root containing the following two files:

Application.cfc:

component {
	this.mappings['/coldbox'] = 'someFolder/coldbox';
}


index.cfm:

<cfscript>
	public void function setMappings() {
		var metadata = getApplicationMetadata();
		metadata.mappings['/cbantisamy'] = 'C:\someOtherFolder/cbantisamy';
	}
	
	// The only custom mapping at this point should be to /coldbox
	WriteOutput('<p>' & expandPath( '/cbantisamy' ) & '<br />' & expandPath( '/coldbox' ) & '</p>');

	// We set an application-specific mapping using application metadata
	setMappings();

	// Expected: cbantisamy has a new mapping
	// Actual: Mappings have not changed!
	WriteOutput('<p>' & expandPath( '/cbantisamy' ) & '<br />' & expandPath( '/coldbox' ) & '</p>');

	// Call getApplicationMetadata() an additional time
	getApplicationMetadata();

	// Mappings have suddenly changed!
	WriteOutput('<p>' & expandPath( '/cbantisamy' ) & '<br />' & expandPath( '/coldbox' ) & '</p>');
</cfscript>

Navigate to index.cfm in ColdFusion 2018 and compare its results to the results obtained in ColdFusion 2016 or ColdFusion 11.

Actual Result:
In ColdFusion 2018, cbantisamy does not have a correct mapping until getApplicationMetadata() is called an additional time.

Expected Result:
The new mapping for '/cbantisamy' should appear immediately after it is set in the setMappings function, just as it does in ColdFusion 2016 or ColdFusion 11.

Any Workarounds:
Add an additional getApplicationMetadata() before attempting to expand a mapped path

Attachments:

Comments:

I believe these bugs are related to this one: https://tracker.adobe.com/#/view/CF-4198394 https://tracker.adobe.com/#/view/CF-4198397
Comment by Jason F.
30797 | May 21, 2019 05:59:11 PM GMT
Also https://tracker.adobe.com/#/view/CF-4203283
Comment by Jason F.
30803 | May 21, 2019 06:31:10 PM GMT
Hi Jason, Please apply the latest update of CF 2018. This has been fixed.
Comment by Suchika S.
30822 | May 24, 2019 08:55:26 AM GMT
Suchika: Please take a look at the build number I listed with this bug. I am currently on build 2018,0,03,314033, which is ColdFusion 2018 Update 3! There are no other available updates to install at the moment. Either something in update 3 caused this bug to resurface or this bug was never fixed in the first place.
Comment by Jason F.
30826 | May 24, 2019 02:08:21 PM GMT
Hi Jason ,  This bug was never fixed , we will fix this . Thanks for reporting it. Thanks, Suchika
Comment by Suchika S.
30836 | May 29, 2019 12:04:59 PM GMT
Suchika why were the other tickets marked as resolved if this bug was never fixed? This was originally reported back in the 2018 prerelease.
Comment by Bradley W.
30843 | May 29, 2019 08:36:17 PM GMT
We have no proved this issue with Brad Wood on ACF 2016 and 2018 latest patches. Basically any dynamic mapping is lost if concurrent threads are hit. This can render a ColdBox application being reinit to be in a state of being broken or impossible to reinit if in traffic. Basically, we don't believe application metadata and mappings are thread safe and very very problematic.
Vote by Luis M.
30845 | May 29, 2019 11:53:14 PM GMT
We have no proved this issue with Brad Wood on ACF 2016 and 2018 latest patches. Basically any dynamic mapping is lost if concurrent threads are hit. This can render a ColdBox application being reinit to be in a state of being broken or impossible to reinit if in traffic. Basically, we don't believe application metadata and mappings are thread safe and very very problematic.
Comment by Luis M.
30844 | May 29, 2019 11:53:36 PM GMT
I hope this is recognized as the larger issue that it represents - that the application metadata is treated as pseudo-transient, rather than being maintained within a persistent scope ( e.g. `server` or `application` ) and being, generally, immutable on a request-to-request basis. Other than that `this.mappings` keys are declared in the component body of Application.cfc, I see no logical reason why the metadata needs to be re-built with each request, rather than in the `onApplicationStart` event and, then, left alone except for explicit modification until the next app start. ORM config, for example, is generally, immutable after the application start.
Comment by Jonathan C.
30848 | May 30, 2019 01:04:51 AM GMT
See this related ticket that has a full standalone repro case for this issue as well as a broader issue we found which involves separate HTTP requests erasing mappings on unrelated requests. https://tracker.adobe.com/#/view/CF-4204468 We really need this buginess fixed.
Comment by Bradley W.
30850 | May 30, 2019 06:06:16 AM GMT
Please make sure this is fixed in adobe 2016 as well, if not that engine, which is still supported, is going to fail as well. Our current customers are not happy, let's make them happy please.
Comment by Luis M.
30854 | May 30, 2019 12:38:55 PM GMT