ZF-11858: Zend_Captcha_Image garbage collection can result in fatal error when run in parallel
Description
Zend_Captcha_Image garbage collector sometimes results in a fatal error: SplFileInfo::getMTime(): stat failed for XXX.png in in Zend/Captcha/Image.php, at line 583.
I belive that this error occurs only under some load, when two (or more) garbage collectors fire at the same time. One GC tries to run SplFileInfo::getMTime() on file wich was already deleted by other parallel GC.
Solution for this could be some kind of semaphore or at least an additional file_exists() check.
Comments
Posted by Christian Wenz (wenz) on 2012-03-04T17:39:06.000+0000
Patch that adds a file_exists() check before getMTime() call
Posted by Christian Wenz (wenz) on 2012-03-04T17:40:14.000+0000
added a patch using a file_exists() check. Did not supply a unit test since the issue is hard to reproduce and would probably require mocking the file access completely.
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-29T14:55:11.000+0000
Fixed in trunk r24821