<div>I'm trying to deal with connection shutdown logic as an atomic operation. Here's the scenario I'm trying to implement:</div><div><ul><li>An application has 25 subscriptions to different queues on different threads</li>
<li>The rabbitmq Windows service is restarted</li><li>The application detects a connection shutdown has occurred and performs the following actions:</li><ul><li>re-establish the connection once available</li><li>refresh each subscription with the new connection</li>
</ul></ul><div><br></div></div><div>The problem with using ModelShutdown rather than ConnectionShutdown to detect connectoin shutdowns (aside from the obvious reason) is that it doesn't really allow a client to deal with connection shutdown logic atomically. Thinking through what I'd need to do to use ModelShutdown for this scenario seems convoluted at best. My particular design issues aside, don't you agree that ConnectionShutdown should be the event you should subscribe to when you want to know about connection shutdowns?</div>
<div><br></div><div>As far as the blocking, I'm perplexed as to why we wouldn't be seeing the same results. Obviously, having someone on your team be able to reproduce the issue is key to getting it fixed. To make sure we're actually using the same bits, I've uploaded the project I'm testing with to <a href="http://aspiringcraftsman.com/downloads/rabbitmq/">http://aspiringcraftsman.com/downloads/rabbitmq/</a>. If you wouldn't mind, please try with this and see if you get the same results. I'm assuming you don't have the API installed into your GAC.</div>
<div><br></div><div><br></div><div>Derek</div><br><div class="gmail_quote">On Tue, Aug 21, 2012 at 9:38 AM, Emile Joubert <span dir="ltr"><<a href="mailto:emile@rabbitmq.com" target="_blank">emile@rabbitmq.com</a>></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 21/08/12 15:10, Derek Greer wrote:<br>
> My apologizes, I should have included the version number. I see this<br>
> behavior using version 2.8.4 from NuGet. Perhaps you're testing with a<br>
> different version?<br>
<br>
</div>I tested with the latest version, but there have been no changes in that<br>
area since 2.8.4.<br>
<div class="im"><br>
> That aside, there should never be a case when a client of the<br>
> .Net rabbitmq client should be able to call .Close() and cause the API<br>
> to block indefinitely.<br>
<br>
</div>I'm not able to reproduce the deadlock, as I said, I see an exception<br>
(see attached).<br>
<div class="im"><br>
> I appreciate your pointing me to the use of the IModel.ModelShutdown. I<br>
> would have thought that event would be raised any time the model was<br>
> closed rather than being raised exclusively due to a connection<br>
> shutdown. I'll use that if I have to, but wouldn't you agree that<br>
> clients of the API should be able to subscribe to the<br>
> IConnection.ConnectionShutdown event to be alerted to connection<br>
> shutdowns?<br>
<br>
</div>Yes, ModelShutdown is raised when the channel shuts down for any reason,<br>
including due to a network interruption. Clients that need notification<br>
of the network connection shutting down should subscribe to<br>
ConnectionShutdown, as your example illustrates. The library also<br>
includes an example (RabbitMQ.Client.Examples.ExceptionTest) that shows<br>
how to go about this.<br>
<br>
What is the problem you are trying to solve that the alleged deadlock is<br>
preventing you from solving? If the problem is to ensure that channels<br>
are closed when connections shut down, then you don't need to do that,<br>
since the library already takes care of it.<br>
<span class="HOEnZb"><font color="#888888"><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:'times new roman',serif" target="_blank">dbgreer@gmail.com</a><span style="color:rgb(51,51,255);font-family:'times new roman',serif"> | </span><a href="http://twitter.com/derekgreer" style="font-family:'times new roman',serif" target="_blank">@derekgreer</a>
</div><div><span style="color:rgb(51,51,255);font-family:'times new roman',serif"><a href="http://derekgreer.lostechies.com/" target="_blank">lostechies.com</a></span><span style="color:rgb(51,51,255);font-family:'times new roman',serif"> </span><span style="color:rgb(51,51,255);font-family:'times new roman',serif">|</span><span style="color:rgb(51,51,255);font-family:'times new roman',serif"> </span><font color="#3333ff"><font face="'times new roman', serif"><a href="http://derekgreer.freshbrewedcode.com" target="_blank">freshbrewedcode.com</a> </font><span style="font-family:'times new roman',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="'times new roman', serif"><br>
</font></div></div></div></div></div></div><br>