<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">My�apologizes, I should have included the version number. �I see this behavior using version 2.8.4 from NuGet. �Perhaps you&#39;re testing with a different version? �The issue appears to be related to the use of the BlockingCell class used as part of the ShutdownContinuation.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Concerning the example, you&#39;re correct that this example poses a race condition and should be using a try/catch rather than checking for IsOpen(). �That aside, there should never be a case when a client of the .Net rabbitmq client should be able to call .Close() and cause the API to block indefinitely.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
I appreciate your pointing me to the use of the IModel.ModelShutdown. �I would have thought that event would be raised any time the model was closed rather than being raised exclusively due to a connection shutdown. �I&#39;ll use that if I have to, but wouldn&#39;t you agree that clients of the API should be able to subscribe to the IConnection.ConnectionShutdown event to be alerted to connection shutdowns? �</div>
<br><div class="gmail_quote">On Tue, Aug 21, 2012 at 5:49 AM, Emile Joubert <span dir="ltr">&lt;<a href="mailto:emile@rabbitmq.com" target="_blank">emile@rabbitmq.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Derek,<br>
<div class="im"><br>
On 20/08/12 19:29, Derek Greer wrote:<br>
&gt; There appears to be a deadlock if you attempt to dispose, close, or<br>
&gt; abort a channel within the context of an IConnection.ConnectionShutdown<br>
&gt; event.<br>
<br>
</div>Instead of deadlock I get an IO exception. An attempt to close the<br>
channel requires network access, but it is no longer possible for the<br>
channel to communicate over the network.<br>
<br>
System.IO.IOException:<br>
�Unable to write data to the transport connection:<br>
�An existing connection was forcibly closed by the remote host.<br>
System.Net.Sockets.SocketException:<br>
�An existing connection was forcibly closed by the remote host<br>
<div class="im"><br>
&gt; if (channel != null &amp;&amp; channel.IsOpen)<br>
&gt; {<br>
&gt; Console.WriteLine(&quot;Closing channel ...&quot;);<br>
&gt; channel.Close(); // &lt;- Never returns<br>
&gt; Console.WriteLine(&quot;Channel closed.&quot;);<br>
&gt; }<br>
<br>
</div>This code is flawed, because the state of the channel could change<br>
between the query and the action. There is no need to explicitly shut<br>
down the channel when the connection shuts down as this will be done by<br>
the library. Parties can register their interest in channel shutdown<br>
using IModel.ModelShutdown.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
-Emile<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><font face="georgia, serif" color="#c0c0c0">___________________________________________</font></div><font color="#333300" face="verdana, sans-serif"><span style="color:rgb(0,0,0)"><span style="color:rgb(51,51,0)">Derek Greer</span></span></font><div>
<a href="mailto:dbgreer@gmail.com" style="font-family:&#39;times new roman&#39;,serif" target="_blank">dbgreer@gmail.com</a><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif">� � �|�</span><a href="http://twitter.com/derekgreer" style="font-family:&#39;times new roman&#39;,serif" target="_blank">@derekgreer</a>
</div><div><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif"><a href="http://derekgreer.lostechies.com/" target="_blank">lostechies.com</a></span><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif">�</span><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif">|</span><span style="color:rgb(51,51,255);font-family:&#39;times new roman&#39;,serif">�</span><font color="#3333ff"><font face="&#39;times new roman&#39;, serif"><a href="http://derekgreer.freshbrewedcode.com" target="_blank">freshbrewedcode.com</a>�</font><span style="font-family:&#39;times new roman&#39;,serif">| <a href="http://aspiringcraftsman.com" target="_blank">aspiringcraftsman.com</a></span></font></div>
<div><div><div><span style="color:rgb(192,192,192);font-family:georgia,serif">___________________________________________</span><font color="#333300" face="georgia, serif"><br></font><div><div><div><font color="#666666" face="&#39;times new roman&#39;, serif"><br>
</font></div></div></div></div></div></div><br>