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