This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Race Condition in Zend\Cache\Storage\Adapter\Filesystem::prepareDirectoryStructure #6435
Comments
@david-sann You are right. In this case the exception is wrong. |
Handled in #6573 |
Ocramius
added a commit
that referenced
this issue
Nov 22, 2014
Ocramius
added a commit
that referenced
this issue
Nov 22, 2014
Ocramius
added a commit
that referenced
this issue
Nov 22, 2014
gianarb
pushed a commit
to zendframework/zend-cache
that referenced
this issue
May 15, 2015
…cache on prepare directory structure
gianarb
pushed a commit
to zendframework/zend-cache
that referenced
this issue
May 15, 2015
…system-race-conditions-fixes-for-zendframework/zf2#6435' Close zendframework/zendframework#6573 Close zendframework/zendframework#6435
gianarb
pushed a commit
to zendframework/zend-cache
that referenced
this issue
May 15, 2015
…system-race-conditions-fixes-for-zendframework/zf2#6435' into develop Close zendframework/zendframework#6573 Close zendframework/zendframework#6435 Forward port zendframework/zendframework#6573 Forward port zendframework/zendframework#6435
gianarb
pushed a commit
to zendframework/zend-cache
that referenced
this issue
May 15, 2015
boesing
pushed a commit
to laminas/laminas-cache-storage-adapter-apc
that referenced
this issue
May 24, 2020
…cache on prepare directory structure
boesing
pushed a commit
to laminas/laminas-cache-storage-adapter-apc
that referenced
this issue
May 24, 2020
…system-race-conditions-fixes-for-zendframework/zf2#6435' into develop Close zendframework/zendframework#6573 Close zendframework/zendframework#6435 Forward port zendframework/zendframework#6573 Forward port zendframework/zendframework#6435
boesing
pushed a commit
to laminas/laminas-cache-storage-adapter-filesystem
that referenced
this issue
Jul 4, 2020
…cache on prepare directory structure
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In case there are lot of parallel requests writing caches in the same directory, you may have problems at creating the cachedir.
If a parallel request creates the directory between
and
the application will throw an exception.
The solution could be just to add another file_exist($pathname) to the second condition, like this:
I also wrote a little quick and dirty test to verify the problem and the solution:
Because it's difficult to mock built-in-functions, I wrapped the file_exist() in a special class called BuiltInWrapper.
The text was updated successfully, but these errors were encountered: