ebin123456 / py-amqplib

Automatically exported from code.google.com/p/py-amqplib
GNU Lesser General Public License v2.1
0 stars 0 forks source link

amqp.Connection() goes catatonic on invalid credentials #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of amqplib are you using?

Best match: amqplib 0.6

Which broker are you using (RabbitMQ?) which version?

rabbitmq-server-1.6.0-1

Which version of Python?

Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39) 
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin

What steps will reproduce the problem?

1. Create or reset a RabbitMQ node.
2. Run the following:

>>> from amqplib import client_0_8 as amqp
>>> con = amqp.Connection(host='localhost', userid='guest', password='garbage')

3. Note that this expression never completes unless interrupted or the server 
goes down.

What is the expected output? What do you see instead?

Ideally, the Connection constructor should raise an exception that indicates 
that the supplied 
credentials were rejected by the server. I THINK, reading the AMQP 0.8 spec, 
that the server 
should be sending back another Secure method frame or an exception frame, but I 
don't have 
protocol diagnostics in front of me...

Original issue reported on code.google.com by angrybal...@gmail.com on 20 Aug 2009 at 9:14

GoogleCodeExporter commented 9 years ago
From what I can tell, when given bad auth info RabbitMQ just closes the 
connection
without sending any kind of response.  

amqplib 0.6 didn't deal with unexpectedly closed connections very well but that
should have been fixed after 0.6, in this revision

http://code.google.com/p/py-amqplib/source/detail?r=0027351c2ed28b56bf23501cb27b
8a5a9a7f8edf#

When I test the current version of amqplib from the mercurial repository against
RabbitMQ 1.6.0 on FreeBSD, it returns with "IOError: Socket closed" - which is 
all it
can really say for sure since RabbitMQ doesn't send its own explanation of the 
problem.

I'm going to close this as fixed, but please do re-open it if it's still seen 
as a
problem with the current code in the repository.

Original comment by barry.pe...@gmail.com on 20 Aug 2009 at 9:29