8000 [RFC] change lock file directory by fritzmg · Pull Request #1605 · contao/core-bundle · GitHub
[go: up one dir, main page]

Skip to content

[RFC] change lock file directory #1605

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
wants to merge 1 commit into from
Closed

[RFC] change lock file directory #1605

wants to merge 1 commit into from

Conversation

fritzmg
Copy link
Contributor
@fritzmg fritzmg commented Jul 9, 2018

Due to the ongoing problems with the AbstractLockedCommand on Strato, I propose at least the following change: use a /var/locks directory within the project instead of the sys_get_temp_dir() location.

Since we need a read and write file handle for file locks on Solaris, the file permissions of the lock files need to be changed from 0444 to 0666 (see symfony/symfony#27903). Any lock files generated prior to this change will still cause problems. Thus, if the lock files are at least within the user's reach (i.e. in the project directory) such errors would be easier to handle.

Also there is a small bug in PHP that causes the sys_get_temp_dir() function to return the temp path with a trailing slash on Solaris. So all the lock file paths will contain a double slash. But this is just a cosmetic discrepancy and doesn't affect the functionality.

@leofeyer leofeyer added the bug label Jul 9, 2018
@leofeyer leofeyer added this to the 4.4.21 milestone Jul 9, 2018
@leofeyer
Copy link
Member
leofeyer commented Jul 9, 2018

I like the idea. @contao/developers What about you?

@Toflar
Copy link
Member
Toflar commented Jul 9, 2018

I don't like this. I would rather have a general tmp Directory to store stuff into. So a replacement for sys_get_temp_dir(). It's not related to locks at all imho 😄

@fritzmg
Copy link
Contributor Author
fritzmg commented Jul 9, 2018

One reason not to do it would be because then the users would be able to shoot himself in the foot by deleting one or all lock files while they are needed ;)

@Toflar
Copy link
Member
Toflar commented Jul 9, 2018

Related: symfony/symfony#23354

@ausi
Copy link
Member
ausi commented Jul 9, 2018

I’m not sure if I should like this.

If I understood the linked issue about Strato correctly, it was about opening the file handle with write permissions and setting the correct file rights. Wouldn’t these issues have been the same in the /var/locks directory?

As @Toflar already wrote in #1551 (comment) other dependencies might rely on sys_get_temp_dir() too and a /var/locks directory wouldn’t fix that.

IMO if sys_get_temp_dir() doesn’t work on a specific hosting environment, we should try to fix that in the manager if possible.

Any lock files generated prior to this change will still cause problems.

This could also be fixed by changing the hash to md5("v2\0".$this->getContainer()->getParameter('kernel.project_dir')) I think.

@leofeyer leofeyer removed this from the 4.4.21 milestone Jul 11, 2018
@leofeyer
Copy link
Member

Given that symfony/symfony#27903 has been merged, this ticket can be closed.

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

Successfully merging this pull request may close these issues.

4 participants
0