[
https://issues.apache.org/jira/browse/SHINDIG-972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Chabot closed SHINDIG-972.
--------------------------------
Resolution: Fixed
Assignee: Chris Chabot
The new CacheStorageMemcache class in the trunk returns 'false' without
throwing an exception:
(line 59 of CacheStorageMemcache.php):
public function store($key, $value) {
return self::$memcache->set($this->storageKey($key), $value, false, 0);
}
I've applied your suggested patch to the 1.0.x branch, which is slightly
inconsistent with the above behavior, but since it's a stable branch i prefer
to be closer to the older behavior in it, so that became:
// Memcache write can fail occasionally, in a production environment
// it's not a good idea to overreact it
if (Config::get('debug')) {
throw new CacheException("Couldn't store data in cache");
} else {
// If debug is off, we just signal the error in the return value,
// so those who depend on memcache writes could take adequate steps
return false;
}
}
Thanks for the report & patch!
> CacheMemcache is too rigorous on write errors
> ---------------------------------------------
>
> Key: SHINDIG-972
> URL: https://issues.apache.org/jira/browse/SHINDIG-972
> Project: Shindig
> Issue Type: Improvement
> Components: PHP
> Affects Versions: 1.0.x-incubating
> Reporter: Nagy Attila
> Assignee: Chris Chabot
> Fix For: 1.0.0-rc1
>
> Attachments: shindig_memcache_ignore_write_errors.patch
>
>
> Memcache writes can occasionally result in error, even when the server is up
> and running. Such cases could be:
> - memcache is full, and automatic removal is disabled
> - allowed memory is allocated, but there's no slab for the given data size.
> Unfortunately this latter is very common, and bailing out in an error message
> is much more worse than simply not cacheing that certain data.
> I propose, that such errors aren't reported when debug mode is off. So if
> performance degrades, and a developer checks the system in debug mode could
> notice the errors inmediately, but the production system is not affected.
> Patch follows....
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.