GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
I love that haigha is smart enough to continually retry a failed connect (or reconnect), producing helpful log messages the whole time. On the first failed try, however, an unhandled exception spews a traceback onto my console:
2011-07-20 12:15:10 myapp DEBUG disconnecting connection
2011-07-20 12:15:10 myapp DEBUG Pending connect: None
2011-07-20 12:15:10 myapp DEBUG Scheduling a connection in 0
2011-07-20 12:15:10 myapp DEBUG Connecting to myhost on 5672
2011-07-20 12:15:10 myapp ERROR Failed to connect to myhost:5672, will try again in 2 seconds
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/haigha/connection_strategy.py", line 128, in _connect_cb
self._connection.connect( self._cur_host.host, self._cur_host.port )
File "/usr/local/lib/python2.7/dist-packages/haigha/connection.py", line 165, in connect
self._sock.connect( (host,port) )
File "/usr/local/lib/python2.7/dist-packages/eventsocket.py", line 243, in connect
raise socket.error( err, os.strerror(err) )
error: [Errno 111] Connection refused
This isn't an unhandled exception, it's a call to logger.exception in ConnectionStrategy._connect_cb()
Since a message broker that hasn't yet started isn't exactly an unusual situation, it would be helpful to be able to silence the backtrace so real problems can more easily be spotted in the logs. A simple one-line log message would be nice. Is there a recommended way to do this?
Sure, that's sensible. I'll leave it as an exception when debugging is turned on.
Was this supposed to have changed in haigha 0.3.2? It's still logging a traceback when debugging is not enabled.
It wasn't fixed, it's scheduled for the 0.3 series though