You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #15511 [DependencyInjection] Minor - add note that file_put_contents is non-atomic (trakos)
This PR was merged into the 5.4 branch.
Discussion
----------
[DependencyInjection] Minor - add note that file_put_contents is non-atomic
I have minor gripe with article at https://symfony.com/doc/current/components/dependency_injection/compilation.html#dumping-the-configuration-for-performance
While the final snippet is fine, there are some examples along the way that suggest using `file_put_contents` to write cached container, without using `LOCK_EX`. I think that could produce some issues in production environment. With multiple concurrent requests, one might partially write the file, while other could try to require it before it is ready.
Maybe it's worth adding a note as suggested in this MR, to make readers aware of this fact?
Commits
-------
ddb3b80 Note that file_put_contents is non-atomic
0 commit comments