Hi Alexis, thanks for getting in touch with Theo.� However, I&#39;m not sure this addresses my issue.<br><br>I think he&#39;s using &quot;remote&quot; here to refer to the Rabbit process on the other end of the socket from my publisher.� If that Rabbit process goes down, the publisher does receive a SIGPIPE.� However, that is actually my &quot;local&quot; process.� My &quot;remote&quot; process is the Rabbit node on another machine that holds the queue.� My publisher connects to the local Rabbit, and the local Rabbit connects to the remote Rabbit.� If the remote Rabbit goes down, there is no SIGPIPE in my publisher.<br>
<br>The hang in DESTROY was resolved by upgrading Rabbit itself.<br><br>I&#39;ll contact him myself and let you know what I find out.<br><br>Ronald<br><br><br><div class="gmail_quote">On Fri, Jun 3, 2011 at 11:47 AM, Alexis Richardson <span dir="ltr">&lt;<a href="mailto:alexis@rabbitmq.com">alexis@rabbitmq.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Ronald<br>
<br>
I spoke with the author, Theo Schlossnagle, who permitted to post his<br>
reply here:<br>
<br>
-<br>
You must catch SIGPIPE if you plan to handle busted writes on<br>
sockets. This is straight forward from perl.<br>
<br>
The publishes don&#39;t erroneously indicated success as the writes() and<br>
synchronous. The remote is down, but the TCP socket hasn&#39;t realized it<br>
yet... So you write(), which is fine (as the socket hasn&#39;t flushed).<br>
So, if it flushes into the kernel and the kernel knows the socket is<br>
busted -&gt; SIGPIPE, if not, then you&#39;ll get a successful publish. �That<br>
behaviour is expected, no?<br>
<br>
The hang in DESTROY sounds like a bug -- I have not seen that one on<br>
my side. �Would like some more information -- user-space stack trace<br>
of the hung perl process w/ symbols would be awesome.<br>
<br>
You can also open a issue on github for the specific problems<br>
remaining unresolved:<br>
<br>
<a href="https://github.com/omniti-labs/Net--RabbitMQ" target="_blank">https://github.com/omniti-labs/Net--RabbitMQ</a><br>
-<br>
<br>
Hope this helps!<br>
<br>
alexis<br>
<br>
<br>
<br>
On Tue, May 31, 2011 at 6:34 PM, Ronald J Kimball<br>
<div><div></div><div class="h5">&lt;<a href="mailto:rkimball@pangeamedia.com">rkimball@pangeamedia.com</a>&gt; wrote:<br>
&gt; Hi, thanks for the response.� Unfortunately, I haven&#39;t really found an<br>
&gt; answer.<br>
&gt;<br>
&gt; We upgraded RabbitMQ to 2.4.1, after which Net::RabbitMQ no longer hangs<br>
&gt; when the remote server is up but the remote app is down.<br>
&gt;<br>
&gt; However, Net::RabbitMQ still returns a false success when the remote server<br>
&gt; or app goes down after the publisher connects to the local node.� (The queue<br>
&gt; is located on the remote app.)<br>
&gt;<br>
&gt; For now, we&#39;ve switched to having a single node.� This decreases our<br>
&gt; throughput slightly, but at least we don&#39;t risk dropping messages.<br>
&gt;<br>
&gt; I think we must be doing something wrong, but I don&#39;t know what...<br>
&gt;<br>
&gt; Ronald<br>
&gt;<br>
&gt;<br>
&gt; On Tue, May 31, 2011 at 7:41 AM, Alexis Richardson &lt;<a href="mailto:alexis@rabbitmq.com">alexis@rabbitmq.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Ronald<br>
&gt;&gt;<br>
&gt;&gt; Were you able to find an answer to this?<br>
&gt;&gt;<br>
&gt;&gt; alexis<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Thu, May 19, 2011 at 9:44 PM, Ronald J Kimball<br>
&gt;&gt; &lt;<a href="mailto:rkimball@pangeamedia.com">rkimball@pangeamedia.com</a>&gt; wrote:<br>
&gt;&gt; &gt; I&#39;m trying to understand how RabbitMQ behaves under failure conditions,<br>
&gt;&gt; &gt; specifically when using the Net::RabbitMQ Perl module.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; We have RabbitMQ set up with three nodes, one on the backend, which<br>
&gt;&gt; &gt; holds<br>
&gt;&gt; &gt; the actual queues, and two on the frontend, which receive publish<br>
&gt;&gt; &gt; requests.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; RabbitMQ 2.2.0<br>
&gt;&gt; &gt; Net::RabbitMQ 0.1.8<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Below is the chart of behaviors that I have observed.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &quot;+&quot; means the behavior is as I expected: either the message is<br>
&gt;&gt; &gt; successfully<br>
&gt;&gt; &gt; queued, or an error is thrown.<br>
&gt;&gt; &gt; &quot;-&quot; means the behavior is not as I expected, but can be managed:<br>
&gt;&gt; &gt; specifically, the process receives a SIGPIPE, which I can trap and<br>
&gt;&gt; &gt; recover<br>
&gt;&gt; &gt; from.<br>
&gt;&gt; &gt; &quot;!&quot; means the behavior is not as I expected, and cannot be managed: the<br>
&gt;&gt; &gt; message is not queued but no error is thrown and/or the process hangs.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &quot;App down&quot; means I ran `rabbitmqctl stop_app`.� &quot;Daemon down&quot; means I<br>
&gt;&gt; &gt; ran<br>
&gt;&gt; &gt; `rabbitmqctl stop`.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; � As publishing process starts up:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Remote daemon up, app up<br>
&gt;&gt; &gt; ����� + Everything okay<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Remote daemon up, app down<br>
&gt;&gt; &gt; ����� ! Net::RabbitMQ hangs when declaring queue<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Remote daemon down<br>
&gt;&gt; &gt; ����� + Net::RabbitMQ throws error when declaring queue<br>
&gt;&gt; &gt; ������� &quot;Declaring queue: server channel error 404, message: NOT_FOUND -<br>
&gt;&gt; &gt; no<br>
&gt;&gt; &gt; queue &#39;test&#39; in vhost &#39;/&#39;&quot;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Local daemon up, app down<br>
&gt;&gt; &gt; ����� + Net::RabbitMQ throws error when connecting<br>
&gt;&gt; &gt; ������� &quot;Opening socket: Connection refused&quot;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Local daemon down<br>
&gt;&gt; &gt; ����� + Net::RabbitMQ throws error when connecting<br>
&gt;&gt; &gt; ������� &quot;Opening socket: Connection refused&quot;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; � After publishing process starts up:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Local app goes down<br>
&gt;&gt; &gt; ����� - Process receives SIGPIPE<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Local daemon goes down<br>
&gt;&gt; &gt; ����� - Process receives SIGPIPE<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Remote app goes down<br>
&gt;&gt; &gt; ����� ! Net::RabbitMQ falsely indicates success when publishing, then<br>
&gt;&gt; &gt; hangs<br>
&gt;&gt; &gt; (in DESTROY?)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Remote daemon goes down<br>
&gt;&gt; &gt; ����� ! Net::RabbitMQ falsely indicates success when publishing<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Local app goes down, comes back up<br>
&gt;&gt; &gt; ����� - Process receives SIGPIPE<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Local daemon goes down, comes back up<br>
&gt;&gt; &gt; ����� - Process receives SIGPIPE<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Remote app goes down, comes back up<br>
&gt;&gt; &gt; ����� + Everything okay<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ��� Remote daemon goes down, comes back up<br>
&gt;&gt; &gt; ����� + Everything okay<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Have other people had these problems with Net::RabbitMQ?� Can we resolve<br>
&gt;&gt; &gt; these issues by changing something in our RabbitMQ configuration?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; thanks,<br>
&gt;&gt; &gt; Ronald<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; P.S. Here&#39;s my script.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; #!/usr/local/bin/perl<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; use strict;<br>
&gt;&gt; &gt; use warnings;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; use Net::RabbitMQ;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; $| = 1;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; $SIG{&#39;PIPE&#39;} = sub { die &quot;SIGPIPE\n&quot; };<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; my $mq = Net::RabbitMQ-&gt;new();<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; alarm(10);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; print &quot;Connecting\n&quot;;<br>
&gt;&gt; &gt; $mq-&gt;connect(&#39;localhost&#39;, { user =&gt; &#39;engagement&#39;, password =&gt; &#39;********&#39;<br>
&gt;&gt; &gt; })<br>
&gt;&gt; &gt; � or die &quot;Can&#39;t connect to RabbitMQ\n&quot;;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; print &quot;Opening channel\n&quot;;<br>
&gt;&gt; &gt; $mq-&gt;channel_open(1);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; print &quot;Declaring exchange\n&quot;;<br>
&gt;&gt; &gt; $mq-&gt;exchange_declare(1, &#39;ee_exchange&#39;, { durable =&gt; 1 });<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; print &quot;Declaring queue\n&quot;;<br>
&gt;&gt; &gt; $mq-&gt;queue_declare(1, &#39;test&#39;, { durable =&gt; 1 });<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; print &quot;Binding queue\n&quot;;<br>
&gt;&gt; &gt; $mq-&gt;queue_bind(1, &#39;test&#39;, &#39;ee_exchange&#39;, &#39;ee_test&#39;);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; alarm(0);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; print &quot;&gt; &quot;;<br>
&gt;&gt; &gt; &lt;&gt;;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; alarm(10);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; print &quot;Publishing message\n&quot;;<br>
&gt;&gt; &gt; my $rc =<br>
&gt;&gt; &gt; � $mq-&gt;publish(1, &#39;ee_test&#39;, &#39;hello world!&#39;,<br>
&gt;&gt; &gt; �������������� { exchange =&gt; &#39;ee_exchange&#39;, mandatory =&gt; 1, immediate =&gt;<br>
&gt;&gt; &gt; 0<br>
&gt;&gt; &gt; },<br>
&gt;&gt; &gt; �������������� { delivery_mode =&gt; 2 });<br>
&gt;&gt; &gt; print &quot;Result: $rc\n&quot;;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; __END__<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; rabbitmq-discuss mailing list<br>
&gt;&gt; &gt; <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
&gt;&gt; &gt; <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>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>