-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[BUGFIX] [issue#17634] Directly delete the /var/.regenerate file dire… #24560
[BUGFIX] [issue#17634] Directly delete the /var/.regenerate file dire… #24560
Conversation
…ctly after checking it it exists = cleanGeneratedFiles is called during the create function of the ObjectManager which is called during cronjobs
Hi @lewisvoncken. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @kalpmehta, thank you for the review.
|
Hi @lewisvoncken @kalpmehta @adrian-martinez-interactiv4, |
Hi @ihor-sviziev |
Maybe this info can help you decide - https://gist.github.com/piotrekkaminski/bb3967a666ae03ca7d9766252d19376e |
I think that this solution isn't changing the working but only makes sure the regeneration process isn't started twice. |
@ihor-sviziev I agree with you. May be the system would not allow to delete the cache directories when there is active file writing in progress? I am not sure. However, this PR is not changing any such behavior and simply fixes the existing bug reported in #17634 so I didn't put much attention to the bigger picture. |
Hi @joni-jones, |
Hi @ihor-sviziev @kalpmehta @lewisvoncken , I've just seen this PR, sorry for the delay. About removing disabling cache, I agree, as it is not needed by any class involved in cleaning generated files process, so it can be removed along with accesory private methods not needed anymore (getEnabledCacheTypes, disableAllCacheTypes, enableCacheTypes, getEnvPath). But caches remaining disabled is not the problem itself, but the consequence of a filesystem error when concurrence occurs while trying to clean generated code (https://youtu.be/9-X1cIIY7y8). The easiest implementation is putting up the deletion of regenerate flag as follows (current + proposed cache disable removal):
Advantages
Disadvantages
I propose another one, using file locking and concurrency error control, modifying two files: Class \Magento\Framework\Code\GeneratedFiles:
Class \Magento\Framework\App\ObjectManagerFactory (inject FileLock into GeneratedFiles):
This implementation is thought not to block any process execution, relying on only one of them to regenerate files, and to recover from possible errors by request a new regeneration for next process, unlock regenerate process and resuming execution. |
Hi @adrian-martinez-interactiv4, |
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.
Hi @lewisvoncken,
Could you update your PR with changes described by @adrian-martinez-interactiv4 ?
@ihor-sviziev let's wait a bit more for @lewisvoncken response, I can take this one if needed. |
I think in this case would be great to merge PR from you, as this is your
solution :)
…On Mon, 30 Sep 2019 at 16:57, adrian-martinez-interactiv4 < ***@***.***> wrote:
@ihor-sviziev <https://github.com/ihor-sviziev> let's wait a bit more for
@lewisvoncken <https://github.com/lewisvoncken> response, I can take this
one if needed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24560?email_source=notifications&email_token=AAOJOUKIYOX35XJ6CZ5O673QMIAVPA5CNFSM4IVXDWA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD75XGCY#issuecomment-536572683>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOJOUJDE7KBM26LK5CKQZ3QMIAVPANCNFSM4IVXDWAQ>
.
|
@ihor-sviziev PR in progress: #24892 |
Hi @lewisvoncken, Thank you for your contribution! Also there was created new PR #24892 with requested changes, so we'll process it instead. |
Hi @lewisvoncken, thank you for your contribution! |
…ctly after checking it it exists
= cleanGeneratedFiles is called during the create function of the ObjectManager which is called during cronjobs
Description (*)
Fix according to the comment of @adrian-martinez-interactiv4
#17634 (comment)
other solution will be removing cleanGeneratedFiles from \Magento\Framework\App\ObjectManagerFactory::create
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)