<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On 22 Oct 2013, at 11:42, Steve Powell &lt;<a href="mailto:steve@rabbitmq.com">steve@rabbitmq.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Issuing a 'real work' call after closing the channel, like&nbsp;<font face="American Typewriter">channel.basicConsume()</font>, throws an&nbsp;<font face="American Typewriter">AlreadyClosedException</font>, claiming that the connection is closed, but&nbsp;<font face="American Typewriter">conn.isOpen()</font>&nbsp;still returns true.</blockquote><div><br></div><div>Well, it appears that the <font face="American Typewriter">AlreadyClosedException</font> produces the "clean connection shutdown" string when it is a hard error (which is correct). It is called by the (internal) '<font face="American Typewriter">channel.ensureIsOpen()</font>' method (typically, if we are about to communicate across the channel). &nbsp;But the <font face="American Typewriter">reference</font> in the exception is then to a <font face="American Typewriter">Channel</font>, and although the exception implies that the connection has been closed, it hasn't. &nbsp;This appears to contradict the hard error flag: which is supposed to mean the <i>connection</i> is closed.</div><div><br></div><div>I guess this means that the bug is <i>the connection isn't closed by the application initiated call to a closed channel.</i>&nbsp;&nbsp;</div><div><br></div><div>You could argue this particular channel error doesn't violate the protocol, so there is no reason to suppose that the connection would (or should) be closed, so it shouldn't be a hard error. &nbsp;[The code comments imply that <font face="American Typewriter">hardError==true</font> implies that <font face="American Typewriter">getReference()</font> returns a <font face="American Typewriter">Connection</font> object, which is actually <i>not</i> true anyway.]</div><div><br></div><div>As this thread stated right at the beginning (see subject), there is no provision in the code for issuing an <font face="American Typewriter">AlreadyClosedException</font> without it being a hard error. &nbsp;If we could do this, the meaning of hardError would be preserved.</div><div><br></div><div>As in the case of referring to a consumer that the client has no record of, the client code can often determine if the channel is already closed, and <i>not</i>&nbsp;risk any protocol violations before throwing the exception. &nbsp;In these cases, it ought not to be a hard error: the connection can remain unaffected.</div><div><br></div><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); 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; -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-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; -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-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; -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-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; -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-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; -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="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-family: Georgia; font-size: 12px; font-weight: normal; font-style: normal; ">Steve Powell &nbsp;</span><font class="Apple-style-span" face="Georgia" size="3" style="font-family: Georgia; font-size: medium; font-weight: normal; font-style: normal; "><span class="Apple-style-span" style="font-size: 11px; ">[</span></font><i style="font-family: Georgia; font-size: medium; font-weight: normal; font-style: normal; "><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" style="font-family: Georgia; font-size: medium; font-weight: normal; font-style: normal; "><span class="Apple-style-span" style="font-size: 11px; ">: +44-7815-838-558</span></font><font class="Apple-style-span" face="Georgia" style="font-family: Georgia; font-weight: normal; font-style: normal; "><span class="Apple-style-span" style="font-size: 11px; ">]<span class="Apple-converted-space">&nbsp;</span></span><span style="font-size: 10px; ">[</span></font><span style="font-size: 10px; "><a href="http://www.rabbitmq.com/">RabbitMQ</a>,<font face="Helvetica"><i>&nbsp;</i></font><a href="http://gopivotal.com/">Pivotal</a>]</span></div><div style="font-family: Georgia; font-size: medium; font-weight: normal; font-style: normal; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><i style="font-size: 12px; line-height: 19.1875px; ">�L�enfer, c�est les autres.�&nbsp;</i><span style="background-color: rgb(255, 255, 255); font-size: 12px; line-height: 19.1875px; ">Sartre</span></div></span></div></span></div></span></div></div></div></div></div></div></body></html>