-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Hi,
we are observing that exception
Uncaught PHP Exception RuntimeException: "Unable to create the cache directory (/[skipped]/app/cache/prod/twig/c7)." at /[skipped]/vendor/twig/twig/lib/Twig/Cache/Filesystem.php line 60
is raised sporadically.
I am suspecting it's race condition because:
- it happens during creation of first cache folders, when them are created in bulk;
- that folder is actually created and has the same creation time as an exception in log entry
- the was similar behavior reported previously but without resolution.
My assumption is that while two processes / threads initialize the cache concurrently them might:
- try to
mkdir
the same folder simultaneously, - one of them acquire the lock and another got
false
frommkdir
, - while the folder creation still isn't finished by the former process / thread, the latter one would get
false
fromis_dir
check, resulting in the exception.
Probably folder creation should be arranged with mutex, that must be unlocked before is_dir
check.
Metadata
Metadata
Assignees
Labels
No labels