-
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
Clean expired quotes - Fix out of memory on huge quotes list #27260
Clean expired quotes - Fix out of memory on huge quotes list #27260
Conversation
Hi @ihor-sviziev. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
b9ed75f
to
8ea9b0e
Compare
8ea9b0e
to
1031b3b
Compare
I think it's a good idea to cover these changes with some test, but have no ideas which test will be ok there |
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 wait for my pagination fix, your "for" loop with comment would no longer be needed and could be replaced with while.
Yeah, I know, but it works anyway with new and old version, so I decided to
keep it like that.
…On Fri, 13 Mar 2020 at 09:43, Lukasz Bajsarowicz ***@***.***> wrote:
***@***.**** commented on this pull request.
If you wait for my pagination fix, your "for" loop with comment would no
longer be needed
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27260 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOJOUPJV5HJ6NMCAXFNLADRHHP2JANCNFSM4LGHSQXQ>
.
|
The difference is that with while you continuously get the real amount of entries. With for - you get number of pages once and then iterate EDIT: As we discussed on Slack: So your way leave gaps between the pages. Solution for that would be Also surround single removal with try-catch block - when single removal fails, the script still work. |
Hi @lbajsarowicz, |
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.
Improve readability of Integration Tests, and we're ✔️
dev/tests/integration/testsuite/Magento/Sales/Cron/CleanExpiredQuotesTest.php
Outdated
Show resolved
Hide resolved
dev/tests/integration/testsuite/Magento/Sales/Cron/CleanExpiredQuotesTest.php
Outdated
Show resolved
Hide resolved
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.
✔️ Great! Thank you for your contribution!
Hi @lbajsarowicz, thank you for the review.
|
@ihor-sviziev in my case, it started failing with 5000 expired quotes and more, with memory_limit=128M |
@engcom-Alfa for now let's leave it as is, as increasing amount of quotes might cause fatal error in integration tests due to out of memory. Why - because there running also other tests that could leave some not cleaned memory |
@magento create issue |
Failed functional tests not related to the changes in this PR |
Hi @ihor-sviziev, thank you for your contribution! |
Description (*)
On production we had a lot of expired quotes, and during cron run we were getting fatal error:
Investigation found that cron job
sales_clean_quotes
fails with out of memory because it tries to load all quote items at onceRelated Pull Requests
N/A
Fixed Issues (if relevant)
N/A
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)
Resolved issues: