<p>I&#39;ve been using the compiled sources for some time now without any issues, but you can also find the unofficial 2.7.9 release which I guess includes the fixes.</p>
<div class="gmail_quote">On Mar 12, 2012 10:43 PM, &quot;Andrius Norkaitis&quot; &lt;<a href="mailto:andrius.norkaitis@oryo.lt">andrius.norkaitis@oryo.lt</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
Any news about this bug? I get random exceptions (when client disconnects)<br>
when using heartbeat in .NET client 2.7.0/1 which was never a problem with<br>
earlier versions.<br>
<br>
Cannot access a disposed object.<br>
Object name: &#39;System.Net.Sockets.Socket&#39;.<br>
<br>
 � at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel<br>
optionLevel, SocketOptionName optionName, Object optionValue)<br>
 � at System.Net.Sockets.TcpClient.set_LingerState(LingerOption value)<br>
 � at RabbitMQ.Client.Impl.SocketFrameHandler_0_9.Close()<br>
 � at RabbitMQ.Client.Impl.ConnectionBase.FinishClose()<br>
 � at RabbitMQ.Client.Impl.ConnectionBase.HeartbeatReadLoop()<br>
 � at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br>
 � at System.Threading.ExecutionContext.runTryCode(Object userData)<br>
 � at<br>
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedClea<br>
nup(TryCode code, CleanupCode backoutCode, Object userData)<br>
 � at System.Threading.ExecutionContext.RunInternal(ExecutionContext<br>
executionContext, ContextCallback callback, Object state)<br>
 � at System.Threading.ExecutionContext.Run(ExecutionContext<br>
executionContext, ContextCallback callback, Object state)<br>
 � at System.Threading.ThreadHelper.ThreadStart()<br>
<br>
<br>
Best regards,<br>
Andrius<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:rabbitmq-discuss-bounces@lists.rabbitmq.com">rabbitmq-discuss-bounces@lists.rabbitmq.com</a><br>
[mailto:<a href="mailto:rabbitmq-discuss-bounces@lists.rabbitmq.com">rabbitmq-discuss-bounces@lists.rabbitmq.com</a>] On Behalf Of Steve<br>
Powell<br>
Sent: Friday, December 30, 2011 5:30 PM<br>
To: Dave Stevens<br>
Cc: <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
Subject: Re: [rabbitmq-discuss] Possible bug when disposing connections in<br>
.NET client 2.7.0/1<br>
<br>
This really does look like a bug. �Thanks for spotting this.<br>
I&#39;m raising a bugzilla (bug24650) to track it, and will report back.<br>
<br>
Steve Powell �(a yule bunny)<br>
----------some more definitions from the SPD---------- avoirdupois (phr.)<br>
&#39;Would you like peas with that?&#39;<br>
distribute (v.) To denigrate an award ceremony.<br>
definite (phr.) &#39;It&#39;s hard of hearing, I think.&#39;<br>
modest (n.) The most mod.<br>
<br>
On 29 Dec 2011, at 22:16, Dave Stevens wrote:<br>
<br>
&gt; Yes, heartbeat is what is causing this. Version 2.7.1 of the .NET<br>
&gt; client is itself calling System.Net.Sockets.TcpClient.Close() 3 times<br>
&gt; per connection shutdown (4 if shutdown times out).<br>
&gt; ConnectionBase.FinishClose() is called 3 different times when shutting<br>
&gt; down.See MainLoop(), HeartbeatReadLoop(), and HeartbeatWriteLoop() of<br>
&gt; ConnectionBase.cs lines 629, 566 and 538 respectively.<br>
&gt; I am required to set the Heartbeat due to another issue where<br>
&gt; exclusive queues are not being removed at the broker when connections<br>
&gt; died. This prevents components from being able to restart with the<br>
&gt; same queue name.<br>
&gt; See<br>
&gt; <a href="http://stackoverflow.com/questions/8296201/when-does-an-amqp-rabbitmq-" target="_blank">http://stackoverflow.com/questions/8296201/when-does-an-amqp-rabbitmq-</a><br>
&gt; channel-with-no-connections-die/8299475<br>
&gt;<br>
&gt; I believe that even with this, ConnectionBase.FinishClose() will be<br>
&gt; called once successfully which would allow the models to shutdown<br>
&gt; properly. I believe this is a bug though as FinishClose() should not<br>
&gt; be called more than once or it is possible that certain event handlers<br>
&gt; will be called more than once, Session.OnSessionShutdown specifically.<br>
&gt; This may impact certain reconnect implementations.<br>
&gt;<br>
&gt; On Dec 29, 4:38 pm, Simone Busoli &lt;<a href="mailto:simone.bus...@gmail.com">simone.bus...@gmail.com</a>&gt; wrote:<br>
&gt;&gt; What happens if you remove the heartbeat setting?<br>
&gt;&gt; On Dec 29, 2011 5:43 PM, &quot;Dave Stevens&quot; &lt;<a href="mailto:daverstev...@gmail.com">daverstev...@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; I get the same exception with this:<br>
&gt;&gt;<br>
&gt;&gt;&gt; � � � � [Test(Description = &quot;ObjectDispositionException&quot;)]<br>
&gt;&gt;&gt; � � � � public void TestFail()<br>
&gt;&gt;&gt; � � � � {<br>
&gt;&gt;&gt; � � � � � � var cf = new ConnectionFactory<br>
&gt;&gt;&gt; � � � � � � � � � � � � �{<br>
&gt;&gt;&gt; � � � � � � � � � � � � � � �HostName = &quot;10.10.8.96&quot;,<br>
&gt;&gt;&gt; � � � � � � � � � � � � � � �Port = 5672,<br>
&gt;&gt;&gt; � � � � � � � � � � � � � � �RequestedHeartbeat = 2<br>
&gt;&gt;&gt; � � � � � � � � � � � � �};<br>
&gt;&gt;&gt; � � � � � � using (var connection = cf.CreateConnection())<br>
&gt;&gt;&gt; � � � � � � using (var model = connection.CreateModel())<br>
&gt;&gt;&gt; � � � � � � {<br>
&gt;&gt;&gt; � � � � � � � � Thread.Sleep(TimeSpan.FromSeconds(1));<br>
&gt;&gt;&gt; � � � � � � }<br>
&gt;&gt;&gt; � � � � }<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Dec 29, 2011 at 2:59 AM, Simone Busoli<br>
&gt;&gt;&gt; &lt;<a href="mailto:simone.bus...@gmail.com">simone.bus...@gmail.com</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hi Dave, although counterintuitive the documentation of the .NET<br>
&gt;&gt;&gt;&gt; client<br>
&gt;&gt;&gt; states that explicitly. The connection closure/disposal is not<br>
&gt;&gt;&gt; idempotent, i.e. you shall not call it twice.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Dec 29, 2011 1:41 AM, &quot;Dave Stevens&quot; &lt;<a href="mailto:daverstev...@gmail.com">daverstev...@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I am getting the following exception when disposing a connection.<br>
&gt;&gt;&gt;&gt;&gt; I had previously noticed this when going from RabbitMQ Client<br>
&gt;&gt;&gt;&gt;&gt; 2.5.1 to<br>
&gt;&gt;&gt;&gt;&gt; 2.7.0 which caused me to back out the update. I ended up going to<br>
&gt;&gt;&gt;&gt;&gt; 2.7.1 because I thought I found a shutdown issue in my own code.<br>
&gt;&gt;&gt;&gt;&gt; The exception did not present itself again until I started testing<br>
&gt;&gt;&gt;&gt;&gt; some reconnect logic. I first noticed it again after simply<br>
&gt;&gt;&gt;&gt;&gt; pulling the plug on my network.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; System.ObjectDisposedException: Cannot access a disposed object.<br>
&gt;&gt;&gt;&gt;&gt; Object name: &#39;System.Net.Sockets.Socket&#39;.<br>
&gt;&gt;&gt;&gt;&gt; at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel<br>
&gt;&gt;&gt;&gt;&gt; optionLevel, SocketOptionName optionName, Object optionValue) at<br>
&gt;&gt;&gt;&gt;&gt; RabbitMQ.Client.Impl.SocketFrameHandler_0_9.Close()<br>
&gt;&gt;&gt;&gt;&gt; at RabbitMQ.Client.Impl.ConnectionBase.FinishClose()<br>
&gt;&gt;&gt;&gt;&gt; at RabbitMQ.Client.Impl.ConnectionBase.HeartbeatWriteLoop()<br>
&gt;&gt;&gt;&gt;&gt; at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br>
&gt;&gt;&gt;&gt;&gt; at System.Threading.ExecutionContext.runTryCode(Object userData)<br>
&gt;&gt;&gt;&gt;&gt; at<br>
&gt;&gt;<br>
&gt;&gt;&gt; System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaran<br>
&gt;&gt;&gt; teedCle anup(TryCode<br>
&gt;&gt;&gt;&gt;&gt; code, CleanupCode backoutCode, Object userData) at<br>
&gt;&gt;&gt;&gt;&gt; System.Threading.ExecutionContext.RunInternal(ExecutionContext<br>
&gt;&gt;&gt;&gt;&gt; executionContext, ContextCallback callback, Object state) at<br>
&gt;&gt;&gt;&gt;&gt; System.Threading.ExecutionContext.Run(ExecutionContext<br>
&gt;&gt;&gt;&gt;&gt; executionContext, ContextCallback callback, Object state, Boolean<br>
&gt;&gt;&gt;&gt;&gt; ignoreSyncCtx)<br>
&gt;&gt;&gt;&gt;&gt; at System.Threading.ExecutionContext.Run(ExecutionContext<br>
&gt;&gt;&gt;&gt;&gt; executionContext, ContextCallback callback, Object state) at<br>
&gt;&gt;&gt;&gt;&gt; System.Threading.ThreadHelper.ThreadStart()<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; This code is reproducible consistently with the following:<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; using System;<br>
&gt;&gt;&gt;&gt;&gt; using System.Threading;<br>
&gt;&gt;&gt;&gt;&gt; using NUnit.Framework;<br>
&gt;&gt;&gt;&gt;&gt; using RabbitMQ.Client;<br>
&gt;&gt;&gt;&gt;&gt; using RabbitMQ.Client.Framing.v0_9;<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; namespace BT.ThirdPartyProxy.Functional.Test.FunctionalTests<br>
&gt;&gt;&gt;&gt;&gt; {<br>
&gt;&gt;&gt;&gt;&gt; � �[TestFixture]<br>
&gt;&gt;&gt;&gt;&gt; � �public class TestingObjectDispositionException<br>
&gt;&gt;&gt;&gt;&gt; � �{<br>
&gt;&gt;&gt;&gt;&gt; � � � �[Test(Description = &quot;ObjectDispositionException&quot;)]<br>
&gt;&gt;&gt;&gt;&gt; � � � �public void TestFail()<br>
&gt;&gt;&gt;&gt;&gt; � � � �{<br>
&gt;&gt;&gt;&gt;&gt; � � � � � �var cf = new ConnectionFactory<br>
&gt;&gt;&gt;&gt;&gt; � � � � � � � � � � � � {<br>
&gt;&gt;&gt;&gt;&gt; � � � � � � � � � � � � � � HostName = INSERT_IP_HERE,<br>
&gt;&gt;&gt;&gt;&gt; � � � � � � � � � � � � � � Port = 5672,<br>
&gt;&gt;&gt;&gt;&gt; � � � � � � � � � � � � � � RequestedHeartbeat = 2<br>
&gt;&gt;&gt;&gt;&gt; � � � � � � � � � � � � };<br>
&gt;&gt;&gt;&gt;&gt; � � � � � �using (var connection = cf.CreateConnection())<br>
&gt;&gt;&gt;&gt;&gt; � � � � � �using (var model = connection.CreateModel())<br>
&gt;&gt;&gt;&gt;&gt; � � � � � �{<br>
&gt;&gt;&gt;&gt;&gt; � � � � � � � �Thread.Sleep(TimeSpan.FromSeconds(1));<br>
&gt;&gt;&gt;&gt;&gt; � � � � � � � �model.Close(Constants.ReplySuccess, &quot;Goodbye&quot;);<br>
&gt;&gt;&gt;&gt;&gt; � � � � � � � �connection.Close(Constants.ReplySuccess, &quot;Goodbye&quot;);<br>
&gt;&gt;&gt;&gt;&gt; � � � � � � � �Thread.Sleep(TimeSpan.FromSeconds(1));<br>
&gt;&gt;&gt;&gt;&gt; � � � � � �}<br>
&gt;&gt;&gt;&gt;&gt; � � � �}<br>
&gt;&gt;&gt;&gt;&gt; � �}<br>
&gt;&gt;&gt;&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I am using RabbitMQ.Client.dll 2.7.1.0 in .NET 4.0 app on Windows<br>
&gt;&gt;&gt;&gt;&gt; server 2003 going against RabbitMQ 2.7.0 running on Ubuntu.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Status of node rabbit@xxx ...<br>
&gt;&gt;&gt;&gt;&gt; [{pid,1344},<br>
&gt;&gt;&gt;&gt;&gt; �{running_applications,<br>
&gt;&gt;&gt;&gt;&gt; � � [{rabbitmq_management,&quot;RabbitMQ Management Console&quot;,&quot;2.7.0&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{rabbitmq_management_agent,&quot;RabbitMQ Management Agent&quot;,&quot;2.7.0&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{amqp_client,&quot;RabbitMQ AMQP Client&quot;,&quot;2.7.0&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{rabbit,&quot;RabbitMQ&quot;,&quot;2.7.0&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{os_mon,&quot;CPO �CXC 138 46&quot;,&quot;2.2.5&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{sasl,&quot;SASL �CXC 138 11&quot;,&quot;2.1.9.3&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{rabbitmq_mochiweb,&quot;RabbitMQ Mochiweb Embedding&quot;,&quot;2.7.0&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{webmachine,&quot;webmachine&quot;,&quot;1.7.0-rmq2.7.0-hg&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{mochiweb,&quot;MochiMedia Web Server&quot;,&quot;1.3-rmq2.7.0-git&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{inets,&quot;INETS �CXC 138 49&quot;,&quot;5.5.2&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{mnesia,&quot;MNESIA �CXC 138 12&quot;,&quot;4.4.17&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{stdlib,&quot;ERTS �CXC 138 10&quot;,&quot;1.17.3&quot;},<br>
&gt;&gt;&gt;&gt;&gt; � � �{kernel,&quot;ERTS �CXC 138 10&quot;,&quot;2.14.3&quot;}]}, �{os,{unix,linux}},<br>
&gt;&gt;&gt;&gt;&gt; {erlang_version,<br>
&gt;&gt;&gt;&gt;&gt; � � &quot;Erlang R14B02 (erts-5.8.3) [source] [64-bit] [smp:8:8] [rq:8]<br>
&gt;&gt;&gt;&gt;&gt; [async-threads:30] [kernel-poll:true]\n&quot;}, �{memory,<br>
&gt;&gt;&gt;&gt;&gt; � � [{total,31177024},<br>
&gt;&gt;&gt;&gt;&gt; � � �{processes,11828776},<br>
&gt;&gt;&gt;&gt;&gt; � � �{processes_used,11772888},<br>
&gt;&gt;&gt;&gt;&gt; � � �{system,19348248},<br>
&gt;&gt;&gt;&gt;&gt; � � �{atom,1355273},<br>
&gt;&gt;&gt;&gt;&gt; � � �{atom_used,1339382},<br>
&gt;&gt;&gt;&gt;&gt; � � �{binary,84928},<br>
&gt;&gt;&gt;&gt;&gt; � � �{code,14547474},<br>
&gt;&gt;&gt;&gt;&gt; � � �{ets,1099944}]},<br>
&gt;&gt;&gt;&gt;&gt; �{vm_memory_high_watermark,0.39999999995232727},<br>
&gt;&gt;&gt;&gt;&gt; �{vm_memory_limit,<a href="tel:5034326425" value="+15034326425">5034326425</a>}]<br>
&gt;&gt;&gt;&gt;&gt; ...done.<br>
&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt; rabbitmq-discuss mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:rabbitmq-disc...@lists.rabbitmq.com">rabbitmq-disc...@lists.rabbitmq.com</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discu" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discu</a><br>
&gt;&gt;&gt;&gt;&gt; ss<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rabbitmq-discuss mailing list<br>
&gt;&gt; rabbitmq-disc...@lists.rabbitmq.comhttps://<a href="http://lists.rabbitmq.com/cgi-bin" target="_blank">lists.rabbitmq.com/cgi-bin</a><br>
&gt;&gt; /mailman/listinfo/rabbitmq-discuss<br>
&gt; _______________________________________________<br>
&gt; rabbitmq-discuss mailing list<br>
&gt; <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
&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>
<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>
<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>
</blockquote></div>