Skip to content
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

Add option to lock command with flock #7137

Merged

Conversation

Dcoutelle
Copy link
Contributor

Please be sure you are submitting this against the staging branch.

Q A
Bug fix? N
New feature? Y
Automated tests included? N
Related user documentation PR URL N
Related developer documentation PR URL
Issues addressed (#s or URLs)
BC breaks?
Deprecations?

Description:

Add option flock on --lock-mode argument.

This way to use flock is compatible with NFS V4 disk mounting in a distributed environment.
The open LOCK_EX no longer work when a file is open in read-only mode.

The code is greatly inspired from last lock component repository from SF4 (https://symfony.com/doc/current/components/lock.html)

Steps to reproduce the bug:

Steps to test this PR:

  1. open 2 consoles.
  2. run a long execution segment update with mautic:segment:update -x flock in first console.
  3. run the same command in the second console... you must see "Script in progress." message
  4. interrupt script in the first console,
  5. run the command in the second console, that should work.

@npracht npracht added ready-to-test PR's that are ready to test code-review-needed PR's that require a code review before merging enhancement Any improvement to an existing feature or functionality labels Jan 16, 2019
@npracht npracht requested a review from Gregy January 16, 2019 14:49
@alanhartless alanhartless added pending-test-confirmation PR's that require one test before they can be merged and removed code-review-needed PR's that require a code review before merging labels Jan 30, 2019
@alanhartless alanhartless added this to the 2.15.1 milestone Jan 30, 2019
@alanhartless alanhartless added this to Needs Second Test in 2.15.1 Jan 31, 2019
Copy link
Member

@npracht npracht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in production environment for few weeks. It works !

@npracht npracht added ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed pending-test-confirmation PR's that require one test before they can be merged ready-to-test PR's that are ready to test labels Feb 6, 2019
@npracht npracht removed the request for review from Gregy February 6, 2019 15:28
@alanhartless alanhartless merged commit 20d055f into mautic:staging Mar 4, 2019
@alanhartless alanhartless moved this from Needs Second Test to Merged in 2.15.1 Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any improvement to an existing feature or functionality ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged
Projects
No open projects
2.15.1
Merged
Development

Successfully merging this pull request may close these issues.

None yet

3 participants