You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by et3w503 <et...@yahoo.com> on 2011/08/09 09:10:24 UTC

Why not earse unacked DeliveryRecords?

Dear all:

My qpidd server crashed because consumer's behavior.

My consumer program(client) always released message if something could not
be done in Subscribe callback.

But some things are interesting when I looked for the reason why qpidd will
crash.

I found if consumer release message in Subscribe callback, the qpidd server
will not earse unacked DeliveryRecords.

in
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?view=markup

line 695. 

The size of unacked  DeliveryRecords will increase continually until qpidd
server crashes.

Why not earse unacked DeliveryRecords in SemanticState::release ? or any
other idea to prevent this situation?


--
View this message in context: http://apache-qpid-developers.2158895.n2.nabble.com/Why-not-earse-unacked-DeliveryRecords-tp6667136p6667136.html
Sent from the Apache Qpid developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Why not earse unacked DeliveryRecords?

Posted by Gordon Sim <gs...@redhat.com>.
On 08/09/2011 08:10 AM, et3w503 wrote:
> Dear all:
>
> My qpidd server crashed because consumer's behavior.
>
> My consumer program(client) always released message if something could not
> be done in Subscribe callback.

Are you using the qpid::client API and if so are completions being sent? 
What are your subscription settings?

> But some things are interesting when I looked for the reason why qpidd will
> crash.
>
> I found if consumer release message in Subscribe callback, the qpidd server
> will not earse unacked DeliveryRecords.
>
> in
> http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?view=markup
>
> line 695.
>
> The size of unacked  DeliveryRecords will increase continually until qpidd
> server crashes.
>
> Why not earse unacked DeliveryRecords in SemanticState::release ? or any
> other idea to prevent this situation?

You are right, well spotted!

We can only delete the record when ended (released/rejected/accepted) 
*and* completed (at the session level) for window based subscriptions as 
the record is also needed to move the window forward correctly.

However if we have already received completions for the released items, 
then we can - and should - do that removal immediately on release (as 
for reject and accept). I will get a fix in for that (QPID-3400).

Having said that, I am a little surprised that the records are never 
removed (rather than just being removed late) unless it is a result of 
not receiving the completions. That is certainly a possibility if using 
the qpid::client API and never calling accept. If you call 
Session::sendCompletion() after releasing that should provide a workaround.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org