<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>Hi Kristian,</div><div><br></div><div>This behaviour seems incorrect: you should not block forever waiting for</div><div>the Basic.CancelOk reply to come back. There could be a number of</div><div>reasons for this but you *shouldn't* have to acknowledge all messages</div><div>before being able to cancel a consumer.</div><div><br></div><div>I wonder if the consumer is executing other channel methods in its</div><div>callbacks? Possibly Ack, which should be ok; possibly other methods.</div><div><br></div><div>It is entirely possible for consumer callbacks</div><div>(handleDelivery/handleCancel/handleCancelOK etc.) to be called *after*</div><div>you have&nbsp;called the basicCancel() method.</div><div><br></div><div>There are two reasons for this -- one is that the communications with the</div><div>server are asynchronous: deliveries might continue to be made after</div><div>sending the Cancel frame and before getting the CancelOk reply.</div><div><br></div><div>The other reason is that requests to call the callbacks are queued, and</div><div>executed on their own thread in sequence for each channel. A number of</div><div>callbacks may be queued when the basicCancel() method is called. They</div><div>may not have finished executing even when the reply to the basic.cancel</div><div>is received (Basic.CancelOk). Only when the reply is received is the</div><div>call to handleCancelOk() put on the queue for execution, so that it is</div><div>the last callback to be executed.</div><div><br></div><div>For these reasons, you shouldn't consider the Consumer to be stopped</div><div>properly until the last callback (handleCancelOk() or handleCancel())</div><div>has been called.</div><div><br></div><div>If one of the callbacks being processed makes a blocking call, even this</div><div>shouldn't block the reply unless it blocks the channel somehow. So what</div><div>could? I don't know, unless you are issuing a channel.close() or</div><div>something in your consumer callback methods. There could be a bug here</div><div>we ought to know about.</div><div><br></div><div>If you have a stack dump at the point of the hang (jstack is probably</div><div>the easiest way to get this) we should be able to tell what the other</div><div>threads are doing, and then get a clue as to why you are blocked. The</div><div>main thread that is hung is likely to be uninteresting -- it is probably</div><div>waiting for the Basic.CancelOk frame to be received (on a getReply()</div><div>call).</div><div><br></div><div>So please could you tell us a little more about your application? In</div><div>particular, what is your Consumer like? Are the handleDelivery()</div><div>callbacks doing some unusual work with the channel, for instance?</div><div>Anything that would help us get to the bottom of this would be useful.</div></div><div><br></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; "><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, 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, 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, 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>Copyright Dieter Rams, amended March 2003; October 2009; and August 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>
<br><div><div>On 22 May 2013, at 02:19, Kristian Lind &lt;<a href="mailto:klindp@gmail.com">klindp@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I found the problem... I had a message that was not ack.. so now before closing the channel I ack the msg._______________________________________________<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></body></html>