Hello,<div><br></div><div>I am working an a Python program that receives XML-RPC calls from Java clients, and then create AMQP queues for each client.</div><div>To create channel, exchanges and queues, we use pika and SelectConnection.</div>

<div><br></div><div>So I first create and start a SelectConnection, then I create a channel. On the reception of the on_open_callback of the channel, I try to declare a queue.</div><div>The problem is that about 10% of time,�a�weird error occurs on the declaration of the queue :</div>

<div><br></div><div><div>File &quot;/usr/lib/python2.6/multiprocessing/process.py&quot;, line 232, in _bootstrap</div><div>� � self.run()</div><div>� File &quot;/usr/lib/python2.6/multiprocessing/process.py&quot;, line 88, in run</div>

<div>� � self._target(*self._args, **self._kwargs)</div><div>� File &quot;/home/adgeg/Sources/svn/TOTEM/Sandbox/TSP-MARGE-Communication/RabbitMQ/RabbitMQTOTEMLibrary/Python/net/totem/gamelogic/creategamelogicserver.py&quot;, line 42, in createGameLogicServer</div>

<div>� � state.connection.ioloop.start()</div><div>� File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/adapters/select_connection.py&quot;, line 124, in start</div><div>� � self.poller.start()</div><div>� File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/adapters/select_connection.py&quot;, line 374, in start</div>

<div>� � self.poll()</div><div>� File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/adapters/select_connection.py&quot;, line 388, in poll</div><div>� � self._handler(events[0][0], events[0][1])</div><div>� File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/adapters/base_connection.py&quot;, line 134, in _handle_events</div>

<div>� � self._handle_read()</div><div>� File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/adapters/base_connection.py&quot;, line 162, in _handle_read</div><div>� � self._on_data_available(data)</div><div>� File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/connection.py&quot;, line 599, in _on_data_available</div>

<div>� � self._channels[frame.channel_number].transport.deliver(frame)</div><div>� File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/channel.py&quot;, line 64, in deliver</div><div>� � self.frame_dispatcher.process(frame)</div>

<div>� File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/frame.py&quot;, line 202, in process</div><div>� � self._handler(frame)</div><div>� File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/frame.py&quot;, line 220, in _handle_method_frame</div>

<div>� � raise NotImplementedError(frame.method.__class__)</div><div>NotImplementedError: &lt;class &#39;pika.spec.DeclareOk&#39;&gt;</div></div><div><br></div><div>We have already sent you a mail 6 months ago, and someone tell us to change the pika source code to have a better understanding of this error, and here is the result :</div>

<div><div>�File &quot;/home/adgeg/local/bin/pika-0.9.5/pika/frame.py&quot;, line 220, in _handle_method_frame</div><div>� � raise NotImplementedError(frame.method.__class__)</div></div><div>NotImplementedError: &lt;Method([&#39;frame_type=1&#39;, &#39;channel_number=1&#39;, &quot;method=&lt;Queue.DeclareOk([&#39;queue=michel&#39;, &#39;message_count=0&#39;, &#39;consumer_count=0&#39;])&gt;&quot;])&gt;</div>

<div><br></div><div>I have looked to our source code, and I found that we were using the same channel in two different threads.</div><div>So I create a new channel (with its own SelectConnection) for the second thread... but the error is still raised.</div>

<div>Curiously, I have found a way to highly reduce appearance frequency of the error: I accidentally add a call to a system command on the Python source code on the�on_open_callback, just before declaring the queue�(rabbitmqctl list_user_permissions, to check that I have the required permissions to declare a queue).</div>

<div><br></div><div>And now, it seems that we arrived to an�appearance frequency of 3 times on 2000 tries.</div><div>So I suppose that without this additional little time period, the�on_open_callback is triggered, but the channel seems not able to declare a queue.</div>

<div>Do you know some related issues of this kind on SelectConnections?</div><div><br></div><div>Thanks a lot,</div><div><br></div><div>Gabriel Adgeg</div><div><br></div><div>PS : I am using RabbitMQ 2.7.0, Erlang R13B03, Python 2.6.5, pika 0.9.5, on�Ubuntu 10.04.3 LTS. The error also occurs with Erlang R14B04, Python 2.7.2, on Windows XP and Windows 7. And it was already there when we were using RabbitMQ 2.5.1.�</div>