{"action":"created","issue":{"url":"https://api.github.com/repos/rabbitmq/rabbitmq-dotnet-client/issues/272","repository_url":"https://api.github.com/repos/rabbitmq/rabbitmq-dotnet-client","labels_url":"https://api.github.com/repos/rabbitmq/rabbitmq-dotnet-client/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/rabbitmq/rabbitmq-dotnet-client/issues/272/comments","events_url":"https://api.github.com/repos/rabbitmq/rabbitmq-dotnet-client/issues/272/events","html_url":"https://github.com/rabbitmq/rabbitmq-dotnet-client/issues/272","id":185988885,"number":272,"title":"Automatic recovery failures","user":{"login":"MichaelLogutov","id":405031,"avatar_url":"https://avatars.githubusercontent.com/u/405031?v=3","gravatar_id":"","url":"https://api.github.com/users/MichaelLogutov","html_url":"https://github.com/MichaelLogutov","followers_url":"https://api.github.com/users/MichaelLogutov/followers","following_url":"https://api.github.com/users/MichaelLogutov/following{/other_user}","gists_url":"https://api.github.com/users/MichaelLogutov/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelLogutov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelLogutov/subscriptions","organizations_url":"https://api.github.com/users/MichaelLogutov/orgs","repos_url":"https://api.github.com/users/MichaelLogutov/repos","events_url":"https://api.github.com/users/MichaelLogutov/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelLogutov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-28T18:23:28Z","updated_at":"2016-10-28T23:50:48Z","closed_at":null,"body":"We've a quite a number of problems running multiple console applications (via task scheduler) on virtual machine with a lot of them being rabbit mq consumers using this library.\r\n\r\nBasically, our consumers using BasicGet, Ack/Nack in a loop (with a bit of throttle).\r\n\r\nThe problem is when there is something wrong with rabbitmq server or network the channel disconnected  but fails to automatically recover after that.\r\n\r\nHere a sample log of one incedent.\r\n\r\nFirst, we've got this unobserved task exception:\r\n```\r\n28.10.2016 12:34:04 | ERROR | Application | A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.\r\nSystem.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=0, text=\"End of stream\", classId=0, methodId=0, cause=System.IO.EndOfStreamException: Unable to read beyond the end of the stream.\r\n   at RabbitMQ.Client.Impl.Frame.ReadFrom(NetworkBinaryReader reader)\r\n   at RabbitMQ.Client.Impl.SocketFrameHandler.ReadFrame()\r\n   at RabbitMQ.Client.Framing.Impl.Connection.MainLoopIteration()\r\n   at RabbitMQ.Client.Framing.Impl.Connection.MainLoop()\r\n   at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)\r\n   at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)\r\n   at RabbitMQ.Client.Framing.Impl.Model._Private_ChannelOpen(String outOfBand)\r\n   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.CreateNonRecoveringModel()\r\n   at RabbitMQ.Client.Impl.AutorecoveringModel.AutomaticallyRecover(AutorecoveringConnection conn, IConnection connDelegate)\r\n   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.RecoverModels()\r\n   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.PerformAutomaticRecovery()\r\n   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.<>c__DisplayClass84_0.<BeginAutomaticRecovery>b__0()\r\n   at System.Threading.Tasks.Task.Execute()\r\n   --- End of inner exception stack trace ---\r\n---> (Inner Exception #0) RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=0, text=\"End of stream\", classId=0, methodId=0, cause=System.IO.EndOfStreamException: Unable to read beyond the end of the stream.\r\n   at RabbitMQ.Client.Impl.Frame.ReadFrom(NetworkBinaryReader reader)\r\n   at RabbitMQ.Client.Impl.SocketFrameHandler.ReadFrame()\r\n   at RabbitMQ.Client.Framing.Impl.Connection.MainLoopIteration()\r\n   at RabbitMQ.Client.Framing.Impl.Connection.MainLoop()\r\n   at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)\r\n   at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)\r\n   at RabbitMQ.Client.Framing.Impl.Model._Private_ChannelOpen(String outOfBand)\r\n   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.CreateNonRecoveringModel()\r\n   at RabbitMQ.Client.Impl.AutorecoveringModel.AutomaticallyRecover(AutorecoveringConnection conn, IConnection connDelegate)\r\n   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.RecoverModels()\r\n   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.PerformAutomaticRecovery()\r\n   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.<>c__DisplayClass84_0.<BeginAutomaticRecovery>b__0()\r\n   at System.Threading.Tasks.Task.Execute()<---\r\n```\r\n\r\nIn mean time in our trace log:\r\n```\r\n28.10.2016 12:33:30 | DEBUG | Start: ack message 132680\r\n28.10.2016 12:33:49 | DEBUG | Get message from queue\r\n28.10.2016 12:33:50 | DEBUG | Get message from queue\r\n28.10.2016 12:33:55 | DEBUG | Get message from queue\r\n28.10.2016 12:33:57 | DEBUG | Get message from queue\r\n28.10.2016 12:33:59 | DEBUG | Get message from queue\r\n28.10.2016 12:34:01 | DEBUG | Get message from queue\r\n28.10.2016 12:34:02 | DEBUG | Get message from queue\r\n28.10.2016 12:34:04 | DEBUG | Get message from queue\r\n... goes like that for hours ...\r\n```\r\n\r\nThe first line from this code:\r\n```\r\npublic void Ack(IModel channel, ReceivedQueueMessage message)\r\n{\r\n    if (this.configuration.TraceLogging)\r\n        Log.Debug(\"Start: ack message {0}\", message.DeliveryTag);\r\n\r\n    channel.BasicAck(message.DeliveryTag, false);\r\n\r\n    if (this.configuration.TraceLogging)\r\n        Log.Debug(\"Complete: ack message {0}\", message.DeliveryTag);\r\n}\r\n```\r\nAs you can see - it does not returns properly (it actually throws an error as you can see later).\r\nOther lines - a parallel Task calling BasicGet but not receiving anything (it would print \"Got one message\" otherwise with full json of the message). Nedless to say there are a lot of message in the queue at that time.\r\n\r\nSo after receiving an error we've got our connection down which is also correlated with the couple more exceptions in error log:\r\n```\r\n28.10.2016 12:34:19 | ERROR | Application | Unable to write data to the transport connection: An established connection was aborted by the software in your host machine.\r\nSystem.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine\r\n   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)\r\n   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\r\n   --- End of inner exception stack trace ---\r\n   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\r\n   at System.IO.BufferedStream.Flush()\r\n   at RabbitMQ.Client.Impl.SocketFrameHandler.WriteFrame(Frame frame)\r\n   at RabbitMQ.Client.Impl.Command.TransmitAsSingleFrame(Int32 channelNumber, Connection connection)\r\n   at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)\r\n   at RabbitMQ.Client.Impl.ModelBase.ModelSend(MethodBase method, ContentHeaderBase header, Byte[] body)\r\n   at RabbitMQ.Client.Impl.RecoveryAwareModel.BasicAck(UInt64 deliveryTag, Boolean multiple)\r\n   at OurCode.RabbitClientService.Ack(IModel channel, ReceivedQueueMessage message)\r\n   at OurCode.Ack(IModel channel, ReceivedQueueMessage message)\r\n\r\n\r\n28.10.2016 12:35:22 | ERROR | Application | Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=0, text=\"End of stream\", classId=0, methodId=0, cause=System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine\r\n   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)\r\n   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\r\n   --- End of inner exception stack trace ---\r\n   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\r\n   at System.IO.BufferedStream.Flush()\r\n   at RabbitMQ.Client.Impl.SocketFrameHandler.WriteFrame(Frame frame)\r\n   at RabbitMQ.Client.Framing.Impl.Connection.HeartbeatWriteTimerCallback(Object state)\r\nRabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=0, text=\"End of stream\", classId=0, methodId=0, cause=System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine\r\n   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)\r\n   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\r\n   --- End of inner exception stack trace ---\r\n   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\r\n   at System.IO.BufferedStream.Flush()\r\n   at RabbitMQ.Client.Impl.SocketFrameHandler.WriteFrame(Frame frame)\r\n   at RabbitMQ.Client.Framing.Impl.Connection.HeartbeatWriteTimerCallback(Object state)\r\n   at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)\r\n   at RabbitMQ.Client.Impl.ModelBase.ModelSend(MethodBase method, ContentHeaderBase header, Byte[] body)\r\n   at RabbitMQ.Client.Impl.RecoveryAwareModel.BasicNack(UInt64 deliveryTag, Boolean multiple, Boolean requeue)\r\n   at OurCode.RabbitClientService.Nack(IModel channel, ReceivedQueueMessage message)\r\n   at OurCode.QueueService.HandleMessageProcessinigError(ProcessQueueMessagesParams p, IModel channel, ReceivedQueueMessage message, Exception ex)\r\n```\r\n\r\nAfter that application can forever cal BasicGet which does not signals in any way that connection is down and can not be recovered - it's just returns null, as if the queue was empty! Running wireshark in that time confirmed that there were no BasicGet commands send for this queue at that time - so library didn't actually called the server - it's like it tries to use broken connection, swallows the exception and returns null as if nothing happened.\r\n\r\nWe've tried to set UseBackgroundThreadsForIO to false - does nothing (suprisingly we're still getting unobserved task exception - which is not what I was expected by switching of the settings with that name).\r\n\r\nWe even tried AutomaticRecoveryEnabled and TopologyRecoveryEnabled both to false in hope to receive proper exception in BasicGet on channel down - nothing. It silently returns null.\r\n\r\nI don't understand how we should use this library to reliably reconnect in case of channel failures. BasicGet does not throws exception for us to maybe just throw away IConnection and recreate it. And in the same time automatic recovery does nothing for more than an half an hour, while there are other consumers on the same machine that were consuming messages from the same server (but from different queues) successfully at the same time.\r\n\r\nI really whish there were some kind of dead simple HTTP-like Get/Publish/Ack/Nack API without that fancy background threads, locks and autorecoveries if possible - at least we could try to properly react to channel failures and clearly understand what happening.\r\n\r\nWe're using https://www.nuget.org/packages/RabbitMQ.Client/4.1.1-rc1"},"comment":{"url":"https://api.github.com/repos/rabbitmq/rabbitmq-dotnet-client/issues/comments/257054835","html_url":"https://github.com/rabbitmq/rabbitmq-dotnet-client/issues/272#issuecomment-257054835","issue_url":"https://api.github.com/repos/rabbitmq/rabbitmq-dotnet-client/issues/272","id":257054835,"user":{"login":"michaelklishin","id":1090,"avatar_url":"https://avatars.githubusercontent.com/u/1090?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelklishin","html_url":"https://github.com/michaelklishin","followers_url":"https://api.github.com/users/michaelklishin/followers","following_url":"https://api.github.com/users/michaelklishin/following{/other_user}","gists_url":"https://api.github.com/users/michaelklishin/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelklishin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelklishin/subscriptions","organizations_url":"https://api.github.com/users/michaelklishin/orgs","repos_url":"https://api.github.com/users/michaelklishin/repos","events_url":"https://api.github.com/users/michaelklishin/events{/privacy}","received_events_url":"https://api.github.com/users/michaelklishin/received_events","type":"User","site_admin":false},"created_at":"2016-10-28T23:50:48Z","updated_at":"2016-10-28T23:50:48Z","body":"Also, consider using a consumer instead of BasicGet. BasicGet suffers from the same fundamental issues with recovery that QueueingBasicConsumer does and for that we do not claim to support automatic recovery because there is no way to do it without application developer's effort in general (with other consumers it is fairly easy to reason about what a successful recovery should look like).\n\nThis and my earlier comment on what this issue really seems to be about leads me to believe this is mailing list material and not an actionable item at this point.\n\n> On 28 Oct 2016, at 21:23, Michael Logutov <notifications@github.com> wrote:\n> \n> We've a quite a number of problems running multiple console applications (via task scheduler) on virtual machine with a lot of them being rabbit mq consumers using this library.\n> \n> Basically, our consumers using BasicGet, Ack/Nack in a loop (with a bit of throttle).\n> \n> The problem is when there is something wrong with rabbitmq server or network the channel disconnected but fails to automatically recover after that.\n> \n> Here a sample log of one incedent.\n> \n> First, we've got this unobserved task exception:\n> \n> 28.10.2016 12:34:04 | ERROR | Application | A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.\n> System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=0, text=\"End of stream\", classId=0, methodId=0, cause=System.IO.EndOfStreamException: Unable to read beyond the end of the stream.\n>    at RabbitMQ.Client.Impl.Frame.ReadFrom(NetworkBinaryReader reader)\n>    at RabbitMQ.Client.Impl.SocketFrameHandler.ReadFrame()\n>    at RabbitMQ.Client.Framing.Impl.Connection.MainLoopIteration()\n>    at RabbitMQ.Client.Framing.Impl.Connection.MainLoop()\n>    at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)\n>    at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)\n>    at RabbitMQ.Client.Framing.Impl.Model._Private_ChannelOpen(String outOfBand)\n>    at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.CreateNonRecoveringModel()\n>    at RabbitMQ.Client.Impl.AutorecoveringModel.AutomaticallyRecover(AutorecoveringConnection conn, IConnection connDelegate)\n>    at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.RecoverModels()\n>    at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.PerformAutomaticRecovery()\n>    at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.<>c__DisplayClass84_0.<BeginAutomaticRecovery>b__0()\n>    at System.Threading.Tasks.Task.Execute()\n>    --- End of inner exception stack trace ---\n> ---> (Inner Exception #0) RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=0, text=\"End of stream\", classId=0, methodId=0, cause=System.IO.EndOfStreamException: Unable to read beyond the end of the stream.\n>    at RabbitMQ.Client.Impl.Frame.ReadFrom(NetworkBinaryReader reader)\n>    at RabbitMQ.Client.Impl.SocketFrameHandler.ReadFrame()\n>    at RabbitMQ.Client.Framing.Impl.Connection.MainLoopIteration()\n>    at RabbitMQ.Client.Framing.Impl.Connection.MainLoop()\n>    at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)\n>    at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)\n>    at RabbitMQ.Client.Framing.Impl.Model._Private_ChannelOpen(String outOfBand)\n>    at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.CreateNonRecoveringModel()\n>    at RabbitMQ.Client.Impl.AutorecoveringModel.AutomaticallyRecover(AutorecoveringConnection conn, IConnection connDelegate)\n>    at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.RecoverModels()\n>    at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.PerformAutomaticRecovery()\n>    at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.<>c__DisplayClass84_0.<BeginAutomaticRecovery>b__0()\n>    at System.Threading.Tasks.Task.Execute()<---\n> In mean time in our trace log:\n> \n> 28.10.2016 12:33:30 | DEBUG | Start: ack message 132680\n> 28.10.2016 12:33:49 | DEBUG | Get message from queue\n> 28.10.2016 12:33:50 | DEBUG | Get message from queue\n> 28.10.2016 12:33:55 | DEBUG | Get message from queue\n> 28.10.2016 12:33:57 | DEBUG | Get message from queue\n> 28.10.2016 12:33:59 | DEBUG | Get message from queue\n> 28.10.2016 12:34:01 | DEBUG | Get message from queue\n> 28.10.2016 12:34:02 | DEBUG | Get message from queue\n> 28.10.2016 12:34:04 | DEBUG | Get message from queue\n> ... goes like that for hours ...\n> The first line from this code:\n> \n> public void Ack(IModel channel, ReceivedQueueMessage message)\n> {\n>     if (this.configuration.TraceLogging)\n>         Log.Debug(\"Start: ack message {0}\", message.DeliveryTag);\n> \n>     channel.BasicAck(message.DeliveryTag, false);\n> \n>     if (this.configuration.TraceLogging)\n>         Log.Debug(\"Complete: ack message {0}\", message.DeliveryTag);\n> }\n> As you can see - it never returns.\n> Other lines - a parallel Task calling BasicGet but not receiving anything (it would print \"Got one message\" otherwise with full json of the message). Nedless to say there are a lot of message in the queue at that time.\n> \n> So after receiving an error we've got our connection down which is also correlated with the couple more exceptions in error log:\n> \n> 28.10.2016 12:34:19 | ERROR | Application | Unable to write data to the transport connection: An established connection was aborted by the software in your host machine.\n> System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine\n>    at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)\n>    at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\n>    --- End of inner exception stack trace ---\n>    at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\n>    at System.IO.BufferedStream.Flush()\n>    at RabbitMQ.Client.Impl.SocketFrameHandler.WriteFrame(Frame frame)\n>    at RabbitMQ.Client.Impl.Command.TransmitAsSingleFrame(Int32 channelNumber, Connection connection)\n>    at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)\n>    at RabbitMQ.Client.Impl.ModelBase.ModelSend(MethodBase method, ContentHeaderBase header, Byte[] body)\n>    at RabbitMQ.Client.Impl.RecoveryAwareModel.BasicAck(UInt64 deliveryTag, Boolean multiple)\n>    at OurCode.RabbitClientService.Ack(IModel channel, ReceivedQueueMessage message)\n>    at OurCode.Ack(IModel channel, ReceivedQueueMessage message)\n> \n> \n> 28.10.2016 12:35:22 | ERROR | Application | Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=0, text=\"End of stream\", classId=0, methodId=0, cause=System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine\n>    at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)\n>    at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\n>    --- End of inner exception stack trace ---\n>    at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\n>    at System.IO.BufferedStream.Flush()\n>    at RabbitMQ.Client.Impl.SocketFrameHandler.WriteFrame(Frame frame)\n>    at RabbitMQ.Client.Framing.Impl.Connection.HeartbeatWriteTimerCallback(Object state)\n> RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=0, text=\"End of stream\", classId=0, methodId=0, cause=System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine\n>    at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)\n>    at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\n>    --- End of inner exception stack trace ---\n>    at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)\n>    at System.IO.BufferedStream.Flush()\n>    at RabbitMQ.Client.Impl.SocketFrameHandler.WriteFrame(Frame frame)\n>    at RabbitMQ.Client.Framing.Impl.Connection.HeartbeatWriteTimerCallback(Object state)\n>    at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)\n>    at RabbitMQ.Client.Impl.ModelBase.ModelSend(MethodBase method, ContentHeaderBase header, Byte[] body)\n>    at RabbitMQ.Client.Impl.RecoveryAwareModel.BasicNack(UInt64 deliveryTag, Boolean multiple, Boolean requeue)\n>    at OurCode.RabbitClientService.Nack(IModel channel, ReceivedQueueMessage message)\n>    at OurCode.QueueService.HandleMessageProcessinigError(ProcessQueueMessagesParams p, IModel channel, ReceivedQueueMessage message, Exception ex)\n> After that application can forever cal BasicGet which does not signals in any way that connection is down and can not be recovered - it's just returns null, as if the queue was empty! Running wireshark in that time confirmed that there were no BasicGet commands send for this queue at that time - so library didn't actually called the server - it's like it tries to use broken connection, swallows the exception and returns null as if nothing happened.\n> \n> We've tried to set UseBackgroundThreadsForIO to false - does nothing (suprisingly we're still getting unobserved task exception - which is not what I was expected by switching of the settings with that name).\n> \n> We even tried AutomaticRecoveryEnabled and TopologyRecoveryEnabled both to false in hope to receive proper exception in BasicGet on channel down - nothing. It silently returns null.\n> \n> I don't understand how we should use this library to reliably reconnect in case of channel failures. BasicGet does not throws exception for us to maybe just throw away IConnection and recreate it. And in the same time automatic recovery does nothing for more than an half an hour, while there are other consumers on the same machine that were consuming messages from the same server (but from different queues) successfully at the same time.\n> \n> I really whish there were some kind of dead simple HTTP-like Get/Publish/Ack/Nack API without that fancy background threads, locks and autorecoveries if possible - at least we could try to properly react to channel failures and clearly understand what happening.\n> \n> We're using https://www.nuget.org/packages/RabbitMQ.Client/4.1.1-rc1\n> \n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n"}}
{"actor":{"display_login":"michaelklishin"}}