Following up on this problem, I've narrowed the issue down to a trivial example that hangs:<br><br><span style="font-family:courier new,monospace">import pika</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">HOSTNAME = "192.168.78.18" # Plug in your own server name here.</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">if __name__ == '__main__':</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> connection = pika.BlockingConnection(pika.ConnectionParameters(host=HOSTNAME, port=5672))</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> channel = connection.channel()</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> try:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> method_frame, _, body = channel.basic_get(queue="NotAValidQueue")</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> except Exception as e:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> print "channel.basic_get threw %s - This is expected" % (e)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> else:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> print "channel.basic_get unexpectedly did not throw an exception."</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> print "Before channel.tx_select - Will hang on next line."</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> channel.tx_select()</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> print "After channel.tx_select - Unexpectedly got here."</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> channel.tx_commit()</span><br>
<br><br><div class="gmail_quote">On Tue, Mar 27, 2012 at 4:54 PM, Matt Pietrek <span dir="ltr"><<a href="mailto:mpietrek@skytap.com">mpietrek@skytap.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word"><div>I have a Pika 0.9.5. app communicating with a 2.81 rabbitmq-server instance.</div><div><br></div><div>I'm noticing some odd behavior, and am not sure if it's a problem on my end, on rabbitmq's end, or in Pika.</div>
<div><br></div><div>At it's simplest, I'm seeing a call to channel.tx_select() hang. Breaking in with the debugger, the stack looks like this:</div><div><br></div><div><div>_handle_read [base_connection.py:151]<span style="white-space:pre-wrap">        </span></div>
<div>process_data_events [blocking_connection.py:94]<span style="white-space:pre-wrap">        </span></div><div>send_method [blocking_connection.py:244]<span style="white-space:pre-wrap">        </span></div><div>rpc [blocking_connection.py:216]<span style="white-space:pre-wrap">        </span></div>
<div>tx_select [spec.py:2615]<span style="white-space:pre-wrap">        </span></div></div><div><br></div><div>Stepping for a bit, I see that the code never gets out of the loop in the send_method() function.</div><div><br></div>
<div>In ordinary circumstances, my code that calls tx_select() works fine. However, in the case where it hangs, an immediately prior call to channel.basic_get() has thrown an exception:</div><div><br></div><div>'pika.exceptions.AMQPChannelError'>:(404, "NOT_FOUND - no queue 'foobar' in vhost '/'"</div>
<div><br></div><div>I'm baffled. Known issue? Something I'm doing wrong?</div><div><br></div><div>Thanks,</div><div><br></div><div>Matt</div></div>
</blockquote></div><br>