-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
mkdir() race condition in ProxyCacheWarmer #47489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Makes sense to me, can you please send a PR on branch 4.4? |
nicolas-grekas
added a commit
that referenced
this issue
Sep 6, 2022
…ndrey-tech) This PR was merged into the 4.4 branch. Discussion ---------- [Bridge] Fix mkdir() race condition in ProxyCacheWarmer | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix [#47489](#47489) | License | MIT | Doc PR | - The race condition is appears when several processes are attempting to create a same Doctrine Proxy directory which does not yet exist and `\RuntimeException` is thrown in `\Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer`. This PR adds an extra check to `\Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer`. Commits ------- cdb6c15 [Bridge] Fix mkdir() race condition in ProxyCacheWarmer
Do I need to send a PR on branch 6.1? |
No need to, we'll merge 4.4 up to 6.2 soon. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
4.4.44, up to 6.1.x
Description
The race condition is appears when several processes are attempting to create a same Doctrine Proxy directory which does not yet exist and
\RuntimeException
is thrown in\Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer
at line 53:How to reproduce
This issue is difficult to reproduce, as any concurrency-related issues are. It appears when several processes are attempting to create a directory which does not yet exist. Specifically, when one process is between
!is_dir()
and@mkdir()
after another process has already managed to create the directory.Possible Solution
Add an extra check to
\Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer
to line 52:Additional Context
No response
The text was updated successfully, but these errors were encountered: