tracker issue : CF-4205867

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

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



See also
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:
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