[rabbitmq-discuss] pika exceptions

Marek Majkowski majek04 at gmail.com
Fri Feb 4 17:36:43 GMT 2011


On Sat, Jan 29, 2011 at 18:28, Marcin Krol <mrkafk at gmail.com> wrote:
> Hello everyone,
>
> Re "stress test" I wrote about in another mail - even if I increase
> time.sleep pika starts throwing exceptions after a while:
>
>
> Exception in thread Thread-1:
> Traceback (most recent call last):
>  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
>    self.run()
>  File "./rc_mt2.py", line 167, in run
>    self.testfun(*self.args, **self.kwargs)
>  File "./rc_mt2.py", line 179, in rpc_testcall
>    repl = rc.call(hello, servnum, rdonly=rdonly)
>  File "./rc_mt2.py", line 133, in call
>    self.setup_distrib(self.node)
>  File "./rc_mt2.py", line 88, in setup_distrib
>    self.res = self.chan.queue_declare(exclusive = True)
>  File "/usr/local/bin/src/pika/pika/spec.py", line 3003, in queue_declare
>    [Queue.DeclareOk])
>  File "/usr/local/bin/src/pika/pika/channel.py", line 186, in _rpc
>    self._ensure()
>  File "/usr/local/bin/src/pika/pika/channel.py", line 84, in _ensure
>    raise ChannelClosed(self.channel_close)
> ChannelClosed: Connection.Close(class_id = 0, method_id = 0, reply_code
> = 540, reply_text = 'Pika: method not implemented: Exchange.DeclareOk')

You seem to be using threads and global channel and connection instances.
That's a bad idea.

Try using  a dedicated connection for every thread.

Marek


More information about the rabbitmq-discuss mailing list