doctrine / DoctrineMongoDBBundle

Integrates Doctrine MongoDB ODM with Symfony
http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
MIT License
379 stars 229 forks source link

Fix mkdir() race condition #745

Closed andrey-tech closed 1 year ago

andrey-tech commented 1 year ago

Description

mkdir() race condition in cache warmers.

Q A
Branch? 4.5.x
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix Issue #744
License MIT
Doc PR -

The race condition is appears when several processes are attempting to create a same Doctrine Proxy/Hydrator directory which does not yet exist and \RuntimeException is thrown.

This PR adds an extra check !is_dir().

malarzm commented 1 year ago

@andrey-tech thanks for the PR! Would you mind rebasing your branch? I've merged #746 to fix CI issues.

malarzm commented 1 year ago

@andrey-tech mind running vendor/bin/phpcbf to fix coding standards job? Also it looks like you've merged the changes instead of rebasing them - please note the merge commit. Would it be possible to rebase instead? If not, I can do that manually while merging.

malarzm commented 1 year ago

Gonna merge this in #747 with your commit preserved. Thanks @andrey-tech!