Skip to content

[Lock] FlockStore does not create the directory #35697

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

Closed
nikophil opened this issue Feb 13, 2020 · 3 comments · Fixed by #39701
Closed

[Lock] FlockStore does not create the directory #35697

nikophil opened this issue Feb 13, 2020 · 3 comments · Fixed by #39701

Comments

@nikophil
Copy link
Contributor

Symfony version(s) affected: all

Description
The FlockStore does not create the directory if it does not exist.
I don't know if it is made on purpose...

When declaring the lock system with framework bundle:

# /packages/framework.yaml
framework:
    lock:
        file: 'flock://%kernel.project_dir%/var/lock'

This results in The directory "/path/to/var/lock" is not writable. althought the ./var directory is writable.
Why don't we check if the directory exists, and create it if it doesn't?

How to reproduce
Declare the lock with the given yaml, when directory ./var/lock does not exist.

Possible Solution
Create the directory if it doesn't exist, in the FlockStore constructor

@nikophil
Copy link
Contributor Author

i can provide a PR if this behavior was not made on purpose
👍

@jderusse
Copy link
Member

@nikophil I don't remember why we didn't create the file at first. It was copy/pasted from the old flock in Console component. Maybe @lyrixx knows?

@lyrixx
Copy link
Member

lyrixx commented Apr 29, 2020

I don't know. Sorry

@fabpot fabpot closed this as completed Jan 5, 2021
fabpot added a commit that referenced this issue Jan 5, 2021
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Lock] Create flock directory

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #35697
| License       | MIT
| Doc PR        | -

Automatically create the flock directory when does not exists

Commits
-------

be22c37 Create flock directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants