tracker issue : CF-4126642

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

Some cflock names cause deadlocks

| 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: Unspecified

Found In Build/Fixed In Build: Alpha_v12 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Linux All

Vote Count: 2

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
I created two simple CFCs (just one empty init function):
core.test.test
core.rights.rights

And this simple testfile:

<cfset variables.stFactoryObjects = structNew()>
<cflock name="apphelper.createObject_contenscms.core.rights.rights" type="exclusive" timeout="5">
	<cfset oObj = createObject("component", "contenscms.core.rights.rights").init()>
	<cfset variables.stFactoryObjects["contenscms.core.rights.rights"] = oObj>
</cflock>

And I get a deadlock!
"A timeout occurred while attempting to lock apphelper.createObject_contenscms.core.rights.rights."

If I change the lock name to …rights2

<cfset variables.stFactoryObjects = structNew()>
<cflock name="apphelper.createObject_contenscms.core.rights.rights2" type="exclusive" timeout="5">
	<cfset oObj = createObject("component", "contenscms.core.rights.rights").init()>
	<cfset variables.stFactoryObjects["contenscms.core.rights.rights"] = oObj>
</cflock>

there is no problem.

But, if I change the lock name to “test.test”

<cfset variables.stFactoryObjects = structNew()>
<cflock name="apphelper.createObject_contenscms.core.test.test" type="exclusive" timeout="5">
	<cfset oObj = createObject("component", "contenscms.core.test.test").init()>
	<cfset variables.stFactoryObjects["contenscms.core.test.test"] = oObj>
</cflock>

there is also no problem??

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

Watson Bug ID:	4126642

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\Alpha_v12\4044261\test.cfc
	 
\\sjshare.corp.adobe.com\Prereleasebugfiles\ColdFusion\12.0\Alpha_v12\4044261\testlock.cfm
	 
\\sjshare.corp.adobe.com\Prereleasebugfiles\ColdFusion\12.0\Alpha_v12\4044261\rights.cfc

Attachments:

Comments:

This may not be a huge issue for most people but if one is affected by this it will get really messy to debug.
Vote by External U.
3643 | March 09, 2016 04:23:19 AM GMT
Added By: PreRelease User User Name:Harry Klein Note Added: This issue can be closed Date Added :2016-02-26 11:25:37.0 Added By: PreRelease User User Name:Harry Klein Note Added: path -> patch Date Added :2016-02-16 09:48:02.0 Added By: PreRelease User User Name:Harry Klein Note Added: The latest path did not resolve this issue, the setting is still needed Date Added :2016-02-16 09:47:47.0 Added By: PreRelease User User Name:Harry Klein Note Added: Thanks for your help! I can confirm that the setting -Dcoldfusion.udf.reuseTagInstances=false in jvm.conf solves this issue! I am only concerned obout the performance implications, could you please inform me about this setting in detail. Date Added :2016-02-11 09:01:58.0 Added By: PreRelease User User Name:Aaron Neff Note Added: The forum thread discussing this ticket is: http://prerelease.adobe.com/r/?890f59e729ed4d60969e60ca4c038d2a Please follow-up in that thread, not here in this ticket. Date Added :2015-12-16 14:35:53.0 Added By: PreRelease User User Name:Aaron Neff Note Added: I wish the PR tracker sent comment notifications as I'm also very interested in knowing the cause of this issue. Thanks!, -Aaron Date Added :2015-12-09 13:42:41.0 Added By: PreRelease User User Name:Harry Klein Note Added: As I received no response yet: Were you able to execute the portable version I created for you - could you reproduce the error? Date Added :2015-11-30 12:11:38.0 Added By: PreRelease User User Name:Harry Klein Note Added: I just created a complete portable version with acf12 express bundled with our cms. I will also contact "pnayak". Steps to reproduce the problem: ============================================== Unzip "contens_acf12_portable.zip" to c:\ Start MySQL with C:\ColdFusion\start_mysql.bat Start ACF12 with C:\ColdFusion\cfusion\bin Open "http://localhost:8500/contens/index.cfm" Login with user "start" and password "contens" Open "http://localhost:8500/contens/index.cfm?reloadapp=1" Now you will get a lot of Lock Timeout errors The problem seems to be C:\ColdFusion\cfusion\wwwroot\contens\framework\apphelper.cfc (60) <cflock name="apphelper.createObject_#arguments.sObjectPath#" type="exclusive" timeout="10"> <cfif StructKeyExists(variables.stFactoryObjects, arguments.sObjectPath)> <!--- return cached object ---> <cfreturn variables.stFactoryObjects[arguments.sObjectPath]> <cfelse> <!--- object is not cached: create and initialize object with named arguments ---> <cfset oObj = createObject("component", arguments.sObjectPath).init(argumentCollection=arguments)> <cfset variables.stFactoryObjects[arguments.sObjectPath] = oObj> <cfreturn oObj> </cfif> </cflock> Date Added :2015-11-25 11:28:17.0 Added By: PreRelease User User Name:Harry Klein Note Added: Hi, I already sent you some mails and I am still waiting for an answer? Meanwhile I temporary changed the cflock code to Ben Nadels CFRedlock solution (https://github.com/bennadel/CFRedlock) - and it works whitout issues! Of course this is not the solution, but very interesting. I have to analyse what Ben is doing in his code, but I thin ACF 12 is not releasing the locks correctly. Date Added :2015-11-19 09:50:16.0 Added By:pnayak Note Added: changing the bug status to "PRNeedInfo". awaiting files/info from Harry. Date Added :2015-11-02 13:54:44.0 Added By: PreRelease User User Name:Harry Klein Note Added: Thanks for your feedback! You will receive my mail asap. Date Added :2015-11-02 12:39:19.0 Added By:rukumar Note Added: @Harry, it would be great if you can share a portable repro case for us. You can send it to pnayak at adobe.com. Also, please make sure to share the thread dumps that shows a dead lock. Date Added :2015-10-27 01:05:22.0 Added By: PreRelease User User Name:Harry Klein Note Added: Wow, a bugtracker without notifications. I just found out that this incident was closed. I have to repeat that this problem makes our CMS Contens unusable with ACF 12 - the bug is easy reproducible in all dev testservers (Linux and Windows). I already proposed to give the Adobe engineers direct access to our system - and never got an answer ... I can also create a portable version and send it to you? Please reopen this incident! Date Added :2015-10-11 21:22:02.0 Added By:pnayak Note Added: closing this since I have not been able to reproduce the issue. We can reopen this, if hear back from the reporter on the information we need. If anyone runs into something similar please post the details here. Date Added :2015-09-22 12:03:16.0 Added By:pnayak Note Added: Harry, I am unable to observe the issue with a standalone Raijin Alpha build on RHEL7. I am using the test code exactly the way you've written it, and I've put rights.cfc in a directory structure, as stipulated in the code. Can you dump the variables scope before entering the lock to see if the object, being created in the lock, pre-exists. Or if this test code is a part of a larger application, can you run it independently, by placing it your webroot. Lock names are shared by the server, so you may want to restart the server to clear the scope before calling the independent test code. Date Added :2015-09-08 17:22:50.0 Added By: PreRelease User User Name:Aaron Neff Note Added: lol @ subscribing for notifications :) Date Added :2015-08-27 08:50:06.0 Added By: PreRelease User User Name:Adam Cameron Note Added: [subscribe] haha, as if we actually get notifications on this stupid thing. Date Added :2015-08-27 08:26:43.0 Added By: PreRelease User User Name:Harry Klein Note Added: Entered Bug. Date Added :2015-08-27 08:23:32.0
Comment by CFwatson U.
3638 | March 09, 2016 04:23:20 AM GMT
this is still broken in the release version. even the -Dcoldfusion.udf.reuseTagInstances=false doesn't fix it.
Comment by External U.
3639 | April 18, 2016 05:34:37 AM GMT
this was struck straight away on my system - i extensively use locks in udfs that are persisted across requests. very bad.
Vote by External U.
3644 | April 18, 2016 04:18:45 PM GMT
anyone at adobe looking at this forum?
Comment by External U.
3640 | April 26, 2016 05:05:42 PM GMT
Just commenting here because this bit me on CF 2016 upgrade. It appears to be fixed in Updater 1, at least according to the release notes. We'll be testing soon: https://helpx.adobe.com/coldfusion/kb/bugs-fixed-coldfusion-2016-update-1.html#main-pars_header_287638495
Comment by External U.
3641 | May 10, 2016 02:12:27 PM 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.
3642 | July 30, 2017 06:19:11 PM GMT