tracker issue : CF-4205867

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

ColdFusion Runtime's implementation of WeakHashMap generates infinite loop when there is a high number of concurrent requests to a cached resource

| View in Tracker

Status/Resolution/Reason: Open//

Reporter/Name(from Bugbase): A. B. / ()

Created: 11/13/2019

Components: Caching, Distributed Caching

Versions: 2018

Failure Type:

Found In Build/Fixed In Build: 2018.0.05.315699 /

Priority/Frequency: Normal /

Locale/System: / Win All

Vote Count: 0

Problem Description: Terracotta distributed cache is being used together with Ehcache. When, in a given ColdFusion instance, there is a high number of concurrent requests to a cached resource, an infinite loop usually occurs. Some requests to cache run perpetually. The CPU always increases to 100% eventually.

Steps to Reproduce: 
Configure your application for distributed cache with Ehcache. Set request timeout to 120 seconds.
Emulate the cache functions in the attached CFCs.
Subject calls to the cache functions with a high number of concurrent requests.

Actual Result: You will have periods when some requests to cache functions run perpetually, irrespective of your timeout setting. Also, your instance's CPU will then rise to 100%.

Expected Result:
No infinite loops or CPU increase 

Any Workarounds:
Not applicable

Attachments:

Comments:

See also https://tracker.adobe.com/#/view/CF-4202859 https://tracker.adobe.com/#/view/CF-4203666
Comment by A. B.
31797 | November 14, 2019 07:59:13 AM GMT
Web search for issues resulting from infinite loops and high CPU when using WeakHashMap: http://adambien.blog/roller/abien/entry/endless_loops_in_unsychronized_weakhashmap https://access.redhat.com/solutions/55161 https://issues.jenkins-ci.org/browse/JENKINS-47725 https://issues.jenkins-ci.org/browse/JENKINS-41797 https://jira.pentaho.com/browse/PDI-14882 https://www-01.ibm.com/support/docview.wss?uid=swg1PI92940 https://bugs.eclipse.org/bugs/show_bug.cgi?id=397439 https://bz.apache.org/bugzilla/show_bug.cgi?id=50078 https://issues.apache.org/jira/browse/SLING-3317 https://issues.jboss.org/browse/JBWEB-185
Comment by A. B.
31798 | November 14, 2019 08:01:49 AM GMT
The methods to be looked into in the attached files are: conditionalCacheGet() in Caching.cfc: line 118 removeCacheItemsUserClasscodes() in Classcodes.cfc: line 48 saveUserClasscodes in UserManager.cfc: line 1290
Comment by A. B.
31799 | November 14, 2019 11:42:28 AM GMT