ID: 45558 User updated by: emailforalex at gmail dot com Reported By: emailforalex at gmail dot com Status: Bogus Bug Type: Feature/Change Request Operating System: any PHP Version: 5.2.6 New Comment:
Well, the reason it's under "Feature Request" is that this really should be a feature of PHP. Doing locking on a cache server (or multiple servers) from many web servers trying to access the simultaneously is incredibly hard to implement in PHP as the only place the servers can share a common lock is the caching machine itself. I believe it would be much easier for you to implement this than for developers to write it using PHP. Previous Comments: ------------------------------------------------------------------------ [2008-07-18 23:22:22] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. This is a problem with the application design, you need to do some sort of locking before you read and write the value. ------------------------------------------------------------------------ [2008-07-18 19:14:46] emailforalex at gmail dot com Description: ------------ This "bug" is incredibly hard to track down and reproduce, but is a major issue for high-volume sites using memcache. There is no synchronization mechanism built in when multiple servers serving multiple requests are all trying to read/write to a memcache machine. A race condition occurs where one request (r1) reads from the cache, then a second request (r2) reads from the cache, then r1 writes the same key back to the cache and r2 proceeds to also write that key to the cache. In effect, r2 overwrites the changes by r1. The issue was discovered while using the symfony framework which stores an array of all of its keys in the cache to allow for pattern-based searching of the keys. What sometimes happened is that two writes in a row would happen as described above, and the keys that were added to the array during the first write disappeared. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45558&edit=1