-
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
Message queue consumer never exiting when --max-messages specified. #17951
Comments
Hi @deefco. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
where @deefco do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
@deefco, thank you for your report. |
Hi @okorshenko. Thank you for working on this issue.
|
Hi @okorshenko. Thank you for working on this issue.
|
Is there any update on this? We are trying to run Magento crons using We are also able to replicate this running (On Magento 2.3.0 and 2.3.1) |
Is there any update on this? We are seeing same issues with Kubernetes. Instead of just exiting the consumer if there is no message, Magento waits for messages. So in theory you might have a consumer running forever on a dev environment even if you set |
I never had this issue until I upgraded from 2.3.1 to the new 2.3.2. All of the PIDs on my server are bin/magento queue:consumers:start and end with --max-messages=10000. Because they never exit, lfd (Login Failure Daemon) sends me emails on the hour saying that they're using excessive resources (I.e. Process Time). They simply live too long and lfd keeps letting me know about it. Is there a work-around? Would not like to disable lfd's notification of course. |
Also only have this issue since upgrading to Magento 2.3.2, related issue: #23540 |
Same issue here, on EE |
Same here, upgraded from 2.3.1 to 2.3.2 and started receiving loads of "Excessive resources used" warnings from lfd, all from magento queue:consumers never exiting. |
Hi folks I've send in some proposals for improving these message queue consumer processes to have them waste fewer resources: magento/community-features#180 |
Any update on this @magento-engcom-team ? |
@magento-engcom-team I'm also experiencing this issue and am wondering if this issue has been given any priority or consideration? |
EE merchant here with the same issue. This may be a bit of a dirty workaround but we wrote a quick bash script that runs every 5 minutes looks for cron jobs that are consumers and kills them. Its worked ok and kept the consumers running so far. Script looks like this #!/bin/bash |
@jordanvector |
Is there any update on this? When we have the consumers enabled, our cron jobs stop working entirely. Anyone else have the same issue? (Magento 2.3.3) Currently using |
We added a patch, if there is no 10 messages then stop the job
UPD: 2020-02-06 |
✅ Confirmed by @engcom-Charlie Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
✅ Confirmed by @engcom-Charlie Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
I just had this issue and did a little research. I had this entry in my
It is described in the DevDocs:
I switched the value to |
It seems this project helps mitigate the situation until this is properly solved / documented. https://github.com/magemojo/m2-ce-cron My server load dropped from 12 to 4 after installing. |
I wrote a post about this, but I wanted to note that I believe there is an issue in the documentation. If you look at this file: vendor/magento/framework-message-queue/CallbackInvoker.php You will see that Magento 2 actually makes the default for this setting 1 (contrary to the documentation)
--- I had to force the setting to be 0 by adding the below to env.php:
After doing that, my other cron processes started running again and I no longer saw the parent cron job as "stuck" Full article: https://www.cadence-labs.com/2020/03/magento-2-stuck-or-long-running-cron-after-upgrade-to-2-3-x/ |
@cadencelabs-master Thank you! This is definitely the problem, and the new default causes serious issues for instances hosted in Docker. At a minimum, the documentation for the message queues (https://devdocs.magento.com/guides/v2.3/config-guide/mq/manage-message-queues.html#start-message-queue-consumers) needs to be updated to reflect the default value actually being While I'm glad to see the |
Since the behavior described looks like the desired behavior and we can achieve the expected result with the configuration flag |
We've updated the 2.3.x and 2.4.x devdocs accordingly. See PR magento/devdocs#8010. |
Preconditions
Steps to reproduce
Expected result
Actual result
Additional information
This behaviour is caused by the following commit: https://github.com/magento-partners/magento2ee/commit/19721b54aae0f18632b58486a3af544d37e5a866#diff-9876e6dc23c7c514b028b967d58aa0b0
Which unfortunately isn't public because message queue was developed for EE. The class CallbackInvoker was changed so the path taken when --max-messages is supplied enters an endless loop instead of exiting.
Only information supplied is this: "MAGETWO-57177: [Critical][OMS] Max messages makes the consumer die after existing messages are consumed" even though this is expected behaviour according to the developer documentation.
Can anyone please explain the reason for this change? Opening issue here because message queue is being moved to community edition in 2.3.0
The text was updated successfully, but these errors were encountered: