I can&#39;t tell you why its hanging, but in general when a channel throws an exception, the channel is closed (its how the AMQP protocol works). �Trying to use the channel after a channel exception (or any closed channel) will result in connection exception which will shut down the entire connection.<div>
<br></div><div>-Alan<br><br><div class="gmail_quote">On Wed, Mar 28, 2012 at 2:04 PM, Matt Pietrek <span dir="ltr">&lt;<a href="mailto:mpietrek@skytap.com">mpietrek@skytap.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Following up on this problem, I&#39;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 = &quot;192.168.78.18&quot;� # 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__ == &#39;__main__&#39;:</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=&quot;NotAValidQueue&quot;)</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 &quot;channel.basic_get threw %s - This is expected&quot; % (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 &quot;channel.basic_get unexpectedly did not throw an exception.&quot;</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">��� print &quot;Before channel.tx_select - Will hang on next line.&quot;</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 &quot;After channel.tx_select - Unexpectedly got here.&quot;</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><div class="HOEnZb">
<div class="h5"><br>
<br><br><div class="gmail_quote">On Tue, Mar 27, 2012 at 4:54 PM, Matt Pietrek <span dir="ltr">&lt;<a href="mailto:mpietrek@skytap.com" target="_blank">mpietrek@skytap.com</a>&gt;</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&#39;m noticing some odd behavior, and am not sure if it&#39;s a problem on my end, on rabbitmq&#39;s end, or in Pika.</div>

<div><br></div><div>At it&#39;s simplest, I&#39;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>&#39;pika.exceptions.AMQPChannelError&#39;&gt;:(404, &quot;NOT_FOUND - no queue &#39;foobar&#39; in vhost &#39;/&#39;&quot;</div>

<div><br></div><div>I&#39;m baffled. Known issue? Something I&#39;m doing wrong?</div><div><br></div><div>Thanks,</div><div><br></div><div>Matt</div></div>
</blockquote></div><br>
</div></div><br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br></div>