Ok, I'm able to replicate this now... I can't tell...
# box-products
s
Ok, I'm able to replicate this now... I can't tell you why though! So, I have an item in a diskstore cache with a specific key. The contents of the item is a simple string. If I just call
getCache('MyCacheName').get('MyCacheKey')
a bunch of times (I'm doing it 10,000 times in a loop), I can get the error to appear. I assume it's some kind of race condition. Cachebox is instantiated as a singleton in the server scope and called by multiple sites.
p
Please reply in thread going forwards! It keeps things easier to read and follow... 🙂
✅ 1
s
Sure, thanks. So... this seems to be doing better after a server reboot. I'll keep trying and report back if I can recreate the error again after the cache has filled up a bit.
l
Ok thanks
Once it's reproducible
We can try to address it
s
I can replicate this pretty reliably now. It seems specific to a single DiskStore cache. I have 5 on the application, but only one exhibits the issue. As far as I can tell, it's the only store that contains both query objects, and simple strings. The issue arises when I attempt to return an item containing a simple value, and when there are multiple requests attempting to do that at the same time. For example:
Copy code
Local.CacheKey = 'object_33p79drt94_template_9_';
	for (i=1; i<=10000; i++) {
		writeoutput(i & '<br />');
		Local.ObjectTemplate = Server.CacheBox.getCache('ObjectCache').get(Local.cacheKey);
	}
If I run that from two separate tabs in quick succession, one or both of them will return the error:
The parameter 1 of function ToBinary, which is now /templates/CMSTemplates/Objects/collapsible_snippet.cfm must be a base-64 encoded string.
The original issue I had on 6.1, with lock timeouts being thrown, seems to no longer occur - though this could be a different manifestation of the same underlying issue I guess?
I can throw a different error if I attempt to update that key too:
Copy code
Local.CacheKey = 'testSimpleString';
	Server.CacheBox.getCache('ObjectCache').set(Local.cacheKey, 'Test simple string');
	for (i=1; i<=10000; i++) {
		writeoutput(i & '<br />');
		Local.ObjectTemplate = Server.CacheBox.getCache('ObjectCache').get(Local.cacheKey);
	}
Throws the error:
Error occurred while performing ObjectLoad: the contents of file [B@67a1d91f are damaged or invalid.
So did anyone have any thoughts on this?