<div dir="ltr">Hi Steve,<div><br></div><div>I tried reproducing what you described and wasn't able to. After declaring a consumer on a non-existent queue several times, the connection is still in tact even though the <span style="font-family:arial,sans-serif;font-size:13px">AlreadyClosedException indicates a connection closure. Just want to make sure I'm not missing anything?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">- jonathan</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Oct 16, 2013 at 7:47 AM, Steve Powell <span dir="ltr"><<a href="mailto:steve@rabbitmq.com" target="_blank">steve@rabbitmq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Jonathan,<div><br></div><div>I think it is not a bug but working as designed:<div><br></div><div>The second invocation on the channel is an invocation on a closed channel, and this is a hard error, because it closes the connection. Furthermore this was initiated by an application call rather than arriving out of the blue from the server.</div>
<div><br></div><div>There is no reason to expect that the 'flags' on the AlreadyClosedException have anything to do with the event which closed the channel/connection.</div><div><br></div><div>As to the problem about recovery, it is the first exception (the IOException) which you need to catch; its cause will be the ShutdownSignalException, which tells you what the circumstances of the shutdown are (application?, hard?).</div>
<div><br></div><div>Is this enough to help you recover correctly?</div><div><br></div><div><div>
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Georgia;word-wrap:break-word;word-spacing:0px">
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Georgia;word-wrap:break-word;word-spacing:0px">
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Georgia;word-wrap:break-word;word-spacing:0px">
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Georgia;word-wrap:break-word;word-spacing:0px">
<span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word"><span style="font-style:normal;border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;border-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;border-spacing:0px"><div style="word-wrap:break-word">
<span style="font-family:Georgia;font-weight:normal;font-style:normal;font-size:medium;font-variant:normal;letter-spacing:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;border-spacing:0px;line-height:normal;border-collapse:separate"><div style="word-wrap:break-word">
<span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word"><span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word"><span style="border-spacing:0px;border-collapse:separate"><div style="word-wrap:break-word">
<span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word"><span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word"><span style="border-spacing:0px;border-collapse:separate"><div style="word-wrap:break-word">
<span style="font-size:12px">Steve Powell </span><font face="Georgia" size="3"><span style="font-size:11px">[</span></font><i><font face="Georgia" size="3"><span style="font-size:11px">Cell</span></font></i><font face="Georgia" size="3"><span style="font-size:11px">: <a href="tel:%2B44-7815-838-558" value="+447815838558" target="_blank">+44-7815-838-558</a></span></font><font face="Georgia" size="3"><span style="font-size:11px">]</span></font></div>
</span></div></span></div></span><div><i style="font-size:12px;font-style:normal;font-family:Helvetica"><font face="Georgia"><span style="font-size:10px">Links: </span></font></i><a href="http://gopivotal.com/" target="_blank"><i style="font-size:10px">Pivotal</i></a><i style="font-size:12px;font-family:Helvetica"><font face="Georgia" style="font-style:normal"><span style="font-size:10px">, </span></font><font face="Georgia"><span style="font-size:10px"><a href="http://www.springsource.org/" target="_blank">SpringSource</a><span style="font-style:normal">, </span></span></font></i><a href="http://www.vmware.com/" style="font-size:12px;font-family:Helvetica" target="_blank"><i><font face="Georgia"><span style="font-size:10px">VMware</span></font></i></a><i style="font-size:12px;font-style:normal;font-family:Helvetica"><font face="Georgia"><span style="font-size:10px">,</span></font></i><p style="font-size:12px;font-family:Helvetica;display:inline!important">
<i><font face="Georgia"><span style="font-size:10px"> </span></font></i><a href="http://www.eclipse.org/virgo" target="_blank"><i><font face="Georgia"><span style="font-size:10px">Virgo</span></font></i></a><i><font face="Georgia"><span style="font-size:10px">, </span></font></i></p>
<i style="font-size:12px;font-style:normal;font-family:Helvetica"><a href="http://www.rabbitmq.com/" target="_blank"><font face="Georgia"><span style="font-size:10px">RabbitMQ</span></font></a><font face="Georgia"><span style="font-size:10px">.</span></font></i></div>
<div style="font-family:Helvetica;font-size:12px"><i><font face="Georgia"><span style="font-size:10px">-----------------------------------------------------------------------</span></font></i></div><span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word"><span style="border-spacing:0px;border-collapse:separate"><div style="word-wrap:break-word"><span style="border-spacing:0px;border-collapse:separate"><div style="word-wrap:break-word">
<div><span style="border-collapse:collapse;line-height:14px;font-size:10px"><font color="#3b3b3b">Good design:</font></span></div><div><span style="border-collapse:collapse;line-height:14px;font-size:10px"><font color="#3b3b3b"> is innovative, useful, and aesthetic;</font></span></div>
<div><span style="border-collapse:collapse;line-height:14px"><span style="font-size:10px"><font color="#3b3b3b"> is understandable, unobtrusive, and honest;</font></span></span></div></div></span></div></span><span style="border-collapse:collapse;line-height:14px"><span style="font-size:10px"><font color="#3b3b3b"> is long-lasting, thorough, and environmentally friendly;</font></span></span><span style="border-spacing:0px"><div style="word-wrap:break-word">
<span style="border-spacing:0px"><div style="word-wrap:break-word"><div style="border-collapse:separate"><span style="border-collapse:collapse;line-height:14px"><span style="font-size:10px"><font color="#3b3b3b"> and </font></span></span><i style="color:rgb(59,59,59);font-size:10px;line-height:14px">is as little design as possible.</i></div>
<div style="border-collapse:separate"><span style="border-collapse:collapse;line-height:14px"><font style="color:rgb(102,102,102);font-size:6px"><i>(c) Dieter Rams, amended 2003; 2009; 2012</i></font></span></div></div></span></div>
</span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></div></div></div>
</div>
<br><div><div><div class="h5"><div>On 15 Oct 2013, at 23:56, Jonathan Halterman <<a href="mailto:jhalterman@gmail.com" target="_blank">jhalterman@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div>
<div class="h5"><div dir="ltr">Hey Michael,<div><br></div><div>Yea, you can reproduce both items by attempting to declare a consumer on a non-existent queue twice in a row. The first invocation closes the channel and throws an IOException. The second invocation throws an AlreadyClosedException, though the hardError and initiatedByApplication flags don't match those from the initial failure.</div>
<div><br></div><div>- jonathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 15, 2013 at 3:45 PM, Michael Klishin <span dir="ltr"><<a href="mailto:mklishin@gopivotal.com" target="_blank">mklishin@gopivotal.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On oct 16, 2013, at 1:24 a.m., Jonathan Halterman <<a href="mailto:jhalterman@gmail.com" target="_blank">jhalterman@gmail.com</a>> wrote:<br>
<br>
> I noticed that AlreadyClosedException always sets hardError and initiatedByApplication to true, even if the error was not hard (only the channel was closed) and the channel was not closed by the application. This makes it more difficult to properly recover a closed resource if I can't easily determine which resource was closed and why. Could this be fixed?<br>
<br>
</div>Jonathan,<br>
<br>
This indeed sounds like a bug.<br>
<br>
How can we reproduce it? Simply attempt an operation on a closed channel?<br>
Does it matter how exactly the channel was closed?<br>
<span><font color="#888888"><br>
MK<br>
<br>
<br>
<br>
</font></span></blockquote></div><br></div></div></div>
_______________________________________________<br>rabbitmq-discuss mailing list<br><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">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><br></div></div></div><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></blockquote></div><br></div>