-
Notifications
You must be signed in to change notification settings - Fork 53
clearByTags in Filesystem adapter crashes when .tag file deleted during GlobIterator loop #44
Comments
This issue probably also occurs in the other clearBy* methods where the GlobIterator is used as well. |
hi @skors - thanks for your bug report! This one is really hard to solve and test and it can happen on every function looping over different items. A simple A better solution would be to catch the error on reading the file and afterwords check if the reason of the error is a missing file. Than ignore the error in this case. For removing files there is already a the method |
@marc-mabe okay. I'll try to work on it and maybe you can take a review if i have understood you correctly |
Nice thanks |
@skors any news ? |
@marc-mabe yes, just give me a few days |
@marc-mabe please see bugfix/clear-by-tag_on_filesystem-storage branch at skors/zend-cache I've added tests which can reproduce the error now |
Hi,
we see the following error when using Filesystem storage adapter and deleting a large set of object from cache with
clearByTags()
method.It is not that easy to reproduce but occurs as follows:
GlobIterator
inclearByTags()
looks for all .tag files which holds the cached item tags informationGlobIterator
clearByTags
triggers an error at$this->getFileContent($pathname)
becausefopen()
orfile_get_contents
try to open a non existing file (not existing anymore)Should be simple be avoided by adding
to the foreach loop in
clearByTags()
, but is this right?I also can submit a PR, but until now i do not have found a way to reproduce for a unit test
cheers
The text was updated successfully, but these errors were encountered: