<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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="color: rgb(0, 0, 0); font-family: Georgia; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: Georgia; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: Georgia; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: Georgia; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-style: normal; border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-family: Georgia; font-weight: normal; font-style: normal; font-size: medium; font-variant: normal; letter-spacing: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; line-height: normal; border-collapse: separate; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-spacing: 0px; border-collapse: separate; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-spacing: 0px; border-collapse: separate; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-size: 12px; ">Steve Powell &nbsp;</span><font class="Apple-style-span" face="Georgia" size="3"><span class="Apple-style-span" style="font-size: 11px; ">[</span></font><i><font class="Apple-style-span" face="Georgia" size="3"><span class="Apple-style-span" style="font-size: 11px; ">Cell</span></font></i><font class="Apple-style-span" face="Georgia" size="3"><span class="Apple-style-span" style="font-size: 11px; ">: +44-7815-838-558</span></font><font class="Apple-style-span" face="Georgia" size="3"><span class="Apple-style-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 class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">Links:&nbsp;</span></font></i><a href="http://gopivotal.com/"><i style="font-size: 10px; ">Pivotal</i></a><i style="font-size: 12px; font-family: Helvetica; "><font class="Apple-style-span" face="Georgia" size="2" style="font-style: normal; "><span class="Apple-style-span" style="font-size: 10px; ">,&nbsp;</span></font><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; "><a href="http://www.springsource.org/">SpringSource</a><span style="font-style: normal; ">,&nbsp;</span></span></font></i><a href="http://www.vmware.com/" style="font-size: 12px; font-family: Helvetica; "><i><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">VMware</span></font></i></a><i style="font-size: 12px; font-style: normal; font-family: Helvetica; "><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">,</span></font></i><p style="font-size: 12px; font-family: Helvetica; display: inline !important; "><i><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">&nbsp;</span></font></i><a href="http://www.eclipse.org/virgo"><i><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">Virgo</span></font></i></a><i><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">,&nbsp;</span></font></i></p><i style="font-size: 12px; font-style: normal; font-family: Helvetica; "><a href="http://www.rabbitmq.com/"><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">RabbitMQ</span></font></a><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">.</span></font></i></div><div style="font-family: Helvetica; font-size: 12px; "><i><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">-----------------------------------------------------------------------</span></font></i></div><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-spacing: 0px; border-collapse: separate; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-spacing: 0px; border-collapse: separate; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="border-collapse: collapse; line-height: 14px; font-size: 10px; "><font class="Apple-style-span" color="#3b3b3b">Good design:</font></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; line-height: 14px; font-size: 10px; "><font class="Apple-style-span" color="#3b3b3b">&nbsp; &nbsp;is innovative, useful, and aesthetic;</font></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; line-height: 14px; "><span class="Apple-style-span" style="font-size: 10px; "><font class="Apple-style-span" color="#3b3b3b">&nbsp; &nbsp;is understandable, unobtrusive, and honest;</font></span></span></div></div></span></div></span><span class="Apple-style-span" style="border-collapse: collapse; line-height: 14px; "><span class="Apple-style-span" style="font-size: 10px; "><font class="Apple-style-span" color="#3b3b3b">&nbsp; &nbsp;is long-lasting, thorough, and environmentally friendly;</font></span></span><span class="Apple-style-span" style="border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="border-collapse: separate; "><span class="Apple-style-span" style="border-collapse: collapse; line-height: 14px; "><span class="Apple-style-span" style="font-size: 10px; "><font class="Apple-style-span" color="#3b3b3b">&nbsp; &nbsp;and&nbsp;</font></span></span><i style="color: rgb(59, 59, 59); font-size: 10px; line-height: 14px; ">is&nbsp;as little design as possible.</i></div><div style="border-collapse: separate; "><span class="Apple-style-span" style="border-collapse: collapse; line-height: 14px; "><font class="Apple-style-span" 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>On 15 Oct 2013, at 23:56, Jonathan Halterman &lt;<a href="mailto:jhalterman@gmail.com">jhalterman@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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">&lt;<a href="mailto:mklishin@gopivotal.com" target="_blank">mklishin@gopivotal.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On oct 16, 2013, at 1:24 a.m., Jonathan Halterman &lt;<a href="mailto:jhalterman@gmail.com">jhalterman@gmail.com</a>&gt; wrote:<br>

<br>
&gt; 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 class="HOEnZb"><font color="#888888"><br>
MK<br>
<br>
<br>
<br>
</font></span></blockquote></div><br></div>
_______________________________________________<br>rabbitmq-discuss mailing list<br><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br></blockquote></div><br></div></div></body></html>