-
Notifications
You must be signed in to change notification settings - Fork 48
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
Process stops processing messages after certain amount of time #28
Comments
Could you also post your supervisord config? And both logs are completely empty? Not a single line? |
I cleared all logs today before I started testing. After the process stopped processing messages I checked the logs from rabbitmq-cli-consumer and supervisord and nothing was in it. |
The problem seems to be in the Supervisor config.
Before that i had a much bigger config, but I didn't investigate further, which line was causing the problem. |
It seems that the problem still exists. It worked for like 20 hours, but then stopped to processing messages. I restarted the Supervisor process and then again stopped processing after 5 hours. I setup a test script that I run through Supervisor and it runs without a problem for 2 days now. So Supervisor should not be the problem. |
What do you mean with "stopped processing messages"? Is the consumer still connected to rabbitmq? Or does it die out and supervisor stops restarting it after it fails too many times? Also, I really need some logs from rabbitmq-cli-consumer before I can say anything useful about the problem you describe. |
The error log is empty and in the stdout log is just
By "stopped processing messages" I mean that the process is still running, but no messages are processed anymore. I just discovered that the consumer disconnects from RabbitMQ. I'll keep an eye on the RabbitMQ log to see what happens when the rabbitmq-cli-consumer disconnects. |
There should indeed be some info in the RabbitMQ log when rabbitmq-cli-consumer disconnects. |
After 21 hours it stoped working and I got this in the RabbitMQ log:
Supervisor still shows that the rabbitmq-cli-consumer is running. |
What is your server setup? OS, version, multiple servers? Is it possible to create a vagrant environment in which I can reproduce the errors? We have rabbitmq-cli-consumers processes which are running for months, so I think something in your environment is triggering this behaviour. |
It's a Ubuntu 14.04 machine. rabbitmq-cli-consumer v1.1.0 is installed via the APT repository. Supervisor 3.2.1 installed via pip. RabbitMQ is v3.6.0. Locally on my Vagrant environment I didn't encounter this problem. |
I setup another server (Ubuntu 15.10) and there it currently works for two days. |
@alsar I'm having the same problems. I have ~5 consumers and they all seem to die after 2-3 days. Did you find anything else that could lead to solving this problem? |
@lrauldan can you tell me about your situation? What OS etc? We're on Debian Wheezy and RabbitMQ 3.5.1. Our consumers are running for months with no restart at all. Our queues are quiet only during the nights. We need to find out how to reproduce this problem. |
I'll reopen the issue, because it seems that I'm not the only one that has/had this problem. Maybe this problem is only present on Ubuntu 14.04, as both I and @lrauldan have this problem on the same Ubuntu version. |
But on the other side I didn't have any problems on Vagrant with Ubuntu 14.04. |
Neither did I but after a couple of days on staging we had over 100 messages stuck in our queues. Once I restarted supervisor all of them went thru and got processed without problems. I will fork the consumer over the weekend and see if I can debug it and see what happens when the connection with rabbitmq gets lost. |
The connection itself is handled by streadway/amqp library (https://github.com/streadway/amqp). Maybe there is something usefull in the bug tracker on their Github repository? Nevertheless it could also be caused by something in rabbitmq-cli-consumer, so looking forward to your findings. |
Any news on this @lrauldan ? |
I have the same problem with the release 1.1.0. Somehow, I don't have any issues on another project with only one consumer. My configuration is the following:
|
@ricbra I can confirm that we were not able to reproduce the issue again. The consumers have been running for a couple of months now and none hanged again. |
Hi Ric, I encounter the same problem as others I also run the script under supervisord with minimal config there was no error on supervisord as well and the script status is running as per supervisord. https://github.com/streadway/amqp as per your suggestion on the other post I visit that page and found this information on that github page, I don't know if this is related or not :) mattwilliamson commented 17 days ago When i check your consumer.go is that right The QoS parameter was 0 ? if err := ch.Qos(cfg.Prefetch.Count, 0, cfg.Prefetch.Global); err != nil { Still chasing the ghost here the problem resurface every two days or so. Using Ubuntu 16.04 |
Refer the official docs for the exact params of this method: https://godoc.org/github.com/streadway/amqp#Channel.Qos Second param is Let me know if you solve the problem with this fix. |
This is a sample message that was stucked on queue as soon as I delete this message on queue the consumer script continue to run ric another suggestion I hand in mind how can you enclosed the argument on the invoke script with double quotes? e.g php test.php "base64_encoded message" ? The actual payload is a json encoded message eNoUjjFPwzAQRv/K1bNx7uzETr2lEkJIgCq1A0MWIx+pReJEaQMD4r/jbk+np/ver5jmjzSy8AL35BpjTd02QoqJr9cw3O/PeQw5wvn98cGiheOBoBt5ve120MW4Fs/D27zeLvAaUobum/PGEp5CDnGWcEj9hvhJIUt4CcOWA5zTxF4jub5C3Ve6BSJvjCcr4bQwR49fU19dypPjyVOttEO0xSZNChvnalMKl7JZ8qjg8JOWO+61ItsqjagMib//AAAA//+muzzA |
That doesn't seem to decode correctly? are you sure what's being encoded is valid? |
//$str = "eNoUjjFPwzAQRv/K1bNx7uzETr2lEkJIgCq1A0MWIx+pReJEaQMD4r/jbk+np/ver5jmjzSy8AL35BpjTd02QoqJr9cw3O/PeQw5wvn98cGiheOBoBt5ve120MW4Fs/D27zeLvAaUobum/PGEp5CDnGWcEj9hvhJIUt4CcOWA5zTxF4jub5C3Ve6BSJvjCcr4bQwR49fU19dypPjyVOttEO0xSZNChvnalMKl7JZ8qjg8JOWO+61ItsqjagMib//AAAA//+muzzA"; //$str = base64_decode($str); //$a = json_decode($str); Yes that was I was thinking but try to run the script it will successfully decode the encoded message |
Hi guys, Out of desperation move I slightly modify command_factory.go to send the base64 encoded via STDIN instead of sending the body as parameter. My issue I believed would be the encoded string still large enough even though it was compressed. Though to be honest it's just my hunch because I don't see the argument too long error from PHP resulting the PHP script to bailout and not processed the message. Even though this will not fixed my issue the string limitation as argument is now removed and will be a major leap forward to triage my issue, thanks guys |
To other who might be interested of doing this I attach the code snippet on the other thread look for STDIN on the subject |
Hi Ric, I was able to triage my issue and it's irrelevant on this post, what's relevant is basically we can't never tell what your developer will going to passed on the Queue, all I can say the STDIN enhancement should be in as another user option in the queue config section. Please disregard the QoS issue i didn't touch the code obviously... for me I can say you can now close this issue 👍 |
Hi I am using rabbitmq on heroku. It is working fine that is consumer keeps on processing messages. But whenever I make any change in any file and push the code the connection gets lost. In this case , I need to restart the connection manually by calling the consumer process. Consumer file
Function processOrder() |
Hi, I am also facing the same issue, consumer stops processing messages from queue, even though consumer are running. Queue continues to fill up. I tried to restart the service and consumers but it does not process, it will sometime process couple messages then stops again. RMQ-log.txt Thanks |
same issue here. my workers dieing when my script hits curl timeout in some cases. any solution ? |
Also same issue here. My consumer received The queue setup was intended for real-time messaging. Normally it accepts 50~90 msgs/s and three consumers subscribes this queue. Since it has I grepped the log and merely and found it relevant. Not knowing why it stopped unexpectedly.
Besides, the consumer cannot queue_declare to replace the stopped queue. It cannot recover without deleting the queue manually. |
This also affects us. Please note that you don't need to use this tool (or it's fork) any more since PHP7 came out as that can run for a long time without going funny. There's plenty of articles about using supervisord to do this. As a really crummy stop gap solution, we have set up a weekly cron job to restart the listener (we found it only hung between 2 - 18 months). It's not pretty, but it'll work. |
same here, got the same problem.. We set up restart cron jobs as a workaround too : X |
I'm using your library in combination with Symfony console commands. I set it up, configured it added it to Supervisor and started 2 processes. Everything works fine, but after a few hours (around 3-5) it just stops processing messages from the queue. I then have to restart the processes and then it starts processing messages again. But again, just for few hours.
I looked into log files but its nothing there.
Have you any idea why this could be happening?
My config file:
I'm using the v1.1 (apt package) on Ubuntu 14.04.
The text was updated successfully, but these errors were encountered: