ColdBox Cache fails under high load

Hi All,

We have a fairly high-usage CB site (about 3 mil requests per day)
running on CB 3.0 M3. We have default settings for CB caching. We
have recently been having weird issues with configuration settings
seemingly vanishing and VAR scoped INSTANCE variables that are tied to
Cached items dieing due to references to items that appear to have
been reaped. We kept seeing errors in the log that related to trying
to reference missing methods on a STRING object, or making array
references to a STRING object that were baffling. After a while we
were able to determine that model objects that we were fetching and
trying to execute methods on were actually a STRING object
"_NOTFOUND".

We did some research today to understand how GetModel() interacts with
the CacheManager.

We noticed that the BeanFactory GetModel() method checks first to see
if the model object is in cache, and it so then calls the CacheManger
to return the bean from Cache. However, the actual FETCH of the
object with a LOCK from cache occurs about 7 lines into the get() call
in the CacheManager. Our theory is that under heavy load there is a
race condition and the cache evicts the object AFTER the BeanFactory
checks for the objects existence in cache but BEFORE the LOCK
occurs. Had anyone else experienced anything like this?

Thanks !

BeanFactory.cfc

One additional piece of information.

One of the errors we are getting that seems related to his issue is as
follows:

Object of type class java.lang.String cannot be used as an array

Tag Context: ID: CF_CFPAGE; LINE: 49; TEMPLATE: C:\inetpub\coldbox
\system\cache\policies\LRU.cfc
ID: CF_TEMPLATEPROXY; LINE: 323; TEMPLATE: C:\inetpub\coldbox\system
\cache\CacheManager.cfc

The line of this code in M3 is

  <cffunction name="execute" output="false" access="public"
returntype="void" hint="Execute the policy">
    <cfscript>
      var oCacheManager = getCacheManager();
      var poolMD = oCacheManager.getPoolMetadata(deepCopy=false);
      var LRUIndex = "";
      var indexLength = 0;
      var x = 1;
      var md = "";
      var evictCount = oCacheManager.getCacheConfig().getEvictCount();
      var evictedCounter = 0;

      // Get searchable index
      try{
        LRUIndex = structSort(poolMD,"numeric", "ASC", "LastAccesed");
      }
      catch(Any e){
        $log("error","Error sorting metadata pool. #e.message# #e.detail#.
Serialized Pool: #poolMD.toString()#");
      }
***LINE 49 indexLength = ArrayLen(LRUIndex);

Have you tried ColdBox V3.0M6?

Regards,
Andrew Scott
http://www.andyscott.id.au/