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
Handle custom lock file during the cache clear and force module actions one by one #31820
Conversation
(Edit 20/03 3h30pm) Running campaign https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/4469351523 |
783697e
to
f992bf0
Compare
|
||
// Unlock is registered in another seaprate function to make sure it will be called no matter what | ||
register_shutdown_function(function () use ($kernel) { | ||
$kernel->unlocksCacheClear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you call exit() within one registered shutdown function, processing will stop completely and no other registered shutdown functions will be called.
https://www.php.net/manual/en/function.register-shutdown-function.php
What if some code tied to actionClearSf2Cache
hook executes an exit() call ? Maybe we could have a max_locking_time as a fallback ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean having a timeout after which the file is unlocked? There is no such feature with flock
as far as I know.
But anyway even if the file is not unlocked manually it will be automatically unlocked after the process that locked it ends, so if indeed someone calls exit
in actionClearSf2Cache
even though they SHOULD NEVER DO IT then the file will be unlocked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pragmatic enough for me for a patch 👍
…cesses have to wait until the new container is ready
f992bf0
to
9fc83e8
Compare
…ility to disable it
…rrent one is finished and bulk actions are launched in sequence not in parallel
This pull request seems to contain new translation strings. I have summarized them below to ease up review:
(Note: this is an automated message, but answering it will reach a real human) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but as I understand we will clear the cache for all actions (if clear cache is finish on previous action) on modules ? Not only the last action ?
@mflasquin indeed the clear cache on the last step was an "optimization" because it cost a lot of time, but in the end, considering all the bugs related to cache clearing and the instability it can occur I don't think the small gain is worth the risk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @jolelievre ,
I have tested your PR and it's well fixed !
The automated tests are OK.
It's QA approved 🚀
thank you !
Thank you @jolelievre 🎉 and @djoelleuch ! |
The module management has also been modified, now the bulk actions are forced one by one and when you try to perform two actions at the same time (by clicking on a button for a module while an action is in progress on another) the action is blocked and a warning message warns you that you need to wait