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

socket hangs on channel close, channel close does not return #26

Closed GoogleCodeExporter closed 9 years ago

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

Have you checked to see if there is a newer version in the "Featured
Downloads" section of the front page of this project?
Yes

Which broker are you using (RabbitMQ?) which version?
v2.2.0

Which version of Python?
2.6.2

What steps will reproduce the problem?
1. subscribe by putting basic_consume into a thread
2. kill the thread
3. close the channel (doesn't return)
4. hang

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

 If you control C out, you see the error:
 frame_type, channel, size = unpack('>BHI', self._read(7))
  File "/opt/linux/lib/python2.6/site-packages/amqplib/client_0_8/transport.py", line 200, in _read
    s = self.sock.recv(65536)

The code hangs in the channel close.

Please provide any additional information below.

If you close the connection instead of the channel,
you see the message "socket closed".  So closing the connection
works, but closing the channel doesn't.
If I want to create and destroy channels on-the-fly, this won't work.

Is this a python socket problem or an ampqlib problem?

Original issue reported on code.google.com by r...@haystack.mit.edu on 1 Dec 2010 at 6:43

GoogleCodeExporter commented 9 years ago
I added the timeout patch and the latchup problem appears to have resolved 
itself.

Original comment by r...@haystack.mit.edu on 2 Dec 2010 at 6:20

GoogleCodeExporter commented 9 years ago
Sorry, amqplib is not totally threadsafe.  That's a big omission from the docs, 
fixed in Rev 2c694206543d   

You can however use it in a threaded program as long separate threads keep 
separate Connection objects (and related Channel objects).

Original comment by barry.pe...@gmail.com on 28 Mar 2011 at 9:27