postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.69k stars 357 forks source link

RabbitMQ crashes on node app restart #425

Open andrewhassan opened 8 years ago

andrewhassan commented 8 years ago

Intermittently, if my node process (supervised by PM2 0.14.7) is restarted while connected to a RabbitMQ server, the server will either explode in memory and not accept anything into it's queue through node-amqp or it will die.

System: Ubuntu 14.04.2 LTS RabbitMQ 3.2.4 PM2 0.14.7 Node 2.3.0

Steps to (intermittently) reproduce:

  1. Run node app with PM2
  2. Allow app to subscribe to rabbit queue
  3. Kill or restart app with PM2
  4. RabbitMQ will either explode in memory or crash

When step 4 happens, if it doesn't crash, RabbitMQ will not accept anything into any of it's queues from node-amqp. If an app is subscribed to the queue with node-amqp, it will not consume the queue items. I had success publishing and consuming from the queue using the RabbitMQ web console, which leads me to believe there's some issue with the way node-amqp handles connections and possibly how PM2 let's app terminate connections.