gmr / rabbitpy

A pure python, thread-safe, minimalistic and pythonic RabbitMQ client library
http://rabbitpy.readthedocs.org
BSD 3-Clause "New" or "Revised" License
242 stars 58 forks source link

main thread does not exit when connection fails #124

Open matteogrolla opened 4 years ago

matteogrolla commented 4 years ago

Hi, I'm using rabbitpy 2.0.1 and I was expecting that since vhost got eliminated by mistake the instruction

conn = rabbitpy.Connection(self.url)

would throw an exception and exit

instead what I see is main thread enters an endless loop in connection.py row 313:

while not self._channel0.open: if not self._exceptions.empty(): exception = self._exceptions.get() self._io.stop() raise exception time.sleep(0.01)

and pymongo_server_monitor threads enter endless loop in connection.py row 116

   while not self.__should_stop():
           ...

from the OS point of view the program seems running normally, but it's not and I need to send an alert. What should I do in this situation?

thanks