celery / kombu

Messaging library for Python.
http://kombu.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
2.86k stars 926 forks source link

Broken pipe after rabbitmq restart not detected immediately #59

Open luckyswede opened 13 years ago

luckyswede commented 13 years ago

Hello! I'm using kombu 1.2.1 and amqplib1.0 and python 2.6.1 and rabbitmq 2.5.1.

After a restart of rabbitmq (single node setup) the first call to producer.publish silently returns without transmitting the message. On the second call, I get a "broken pipe" exception, and I recreate the connection and everything works fine.

Why don't I get a broken pipe on the first call? Is this a problem with amqlib or with kombu? I've tried to use the ensure* methods on connection, but no luck. It seems that kombu/amqlib don't understand that the socket is dead.

Thanks / J

andrask commented 6 years ago

@luckyswede We have just hit upon this issue with Kombu 4.4.0 and amqp 2.2.2. Can you please explain what solved your issue? It would be hugely helpful.

luckyswede commented 6 years ago

Sorry, I have no idea. It's been too long..

tilan7663 commented 6 years ago

@andrask, I also run similar issue in the past where message will get lost after the rabbitmq is restart. I was able to get away by setting confirm_publish = True when initializing the amqp.Connection class. Hope this will help you.

andrask commented 6 years ago

@tilan7663 It did help! Thanks a lot!

thedrow commented 6 years ago

@andrask @tilan7663 Could any of you add some documentation on how to resolve this issue and the different tradeoffs?