[
https://issues.apache.org/jira/browse/PROTON-784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14255095#comment-14255095
]
German Shepherd commented on PROTON-784:
----------------------------------------
Sure. I'll be back at work on the first week of January, and I'll immediately
post all the info related to this, including some additional debug prints.
I understand the change (0.8 -> 0.9) as you describe it, there is no issue with
that on my side (I'm starting to like the 0.9 more and more as I go through).
Altough it makes me stuck with 0.8 which keeps the heap usage deterministic and
locked on a particular level, but the 0.9 adds to it the never-released
deliveries, so the heap grows indefinitely.
Generally, I can say I'm running the msgr_recv.c-like code (I run my own app
which is functionaly close to msgr_recv, but in general, there are no specific
changes that should indicate such an issue or make it obvious to happen).
As far as I recall (I'm out of work now), the pn_delivery_finalize() actually
gets called, but it can't release the delivery (or put it on the delivery_pool
list) as there is the tpwork scheduled (and the finalize is not called any more
after that) - the pni_preserve_delivery() returns "true" in the particular call
(although the delivery->local.settled is "true", but the delivery->tpwork is
"true" as well).
The one thing I need is to simply remove the delivery from heap (as the
ultimate outcome - or maybe the deliver_pool list will solve this as well ?),
when it gets the delivery->local.settled set to "true" and all the tpwork
associated to it is done.
> Settled Deliveries keep piling up, and do not seem to get freed from heap
> -------------------------------------------------------------------------
>
> Key: PROTON-784
> URL: https://issues.apache.org/jira/browse/PROTON-784
> Project: Qpid Proton
> Issue Type: Bug
> Components: proton-c
> Affects Versions: 0.9
> Reporter: German Shepherd
> Fix For: 0.9
>
>
> When running the ProtonC 0.8, this issue was not present.
> Then, in ProtonC 0.9 (Git trunk of 12/19/2014), there are changes in a way
> the deliveries are handled (engine.c).
> Correct me if I'm wrong, but given the behavior in 0.8, and keeping the same
> application side approach to ProtonC, while running 0.9, I would expect the
> Deliveries to be eventually freed from heap. Or is there a new plan on how to
> approach this ?
> I'm calling pn_messenger_settle with PN_CUMMULATIVE for both input and output
> trackers, and the delivery->local.settled gets set to true (verified).
> Here is the dump of Deliveries, after there is one message received:
> {{tag=, local.type=36, remote.type=0, local.settled=1, remote.settled=1,
> updated=0, current=0, writable=0, readable=0, work=0}}
> Then my application code sends a message to broker. The previous, now fully
> settled Delivery, is not freed - here is the dump (there are now two
> dispositions on heap):
> {{tag=, local.type=36, remote.type=0, local.settled=1, remote.settled=1,
> updated=0, current=0, writable=0, readable=0, work=0}}
> {{tag=\x00\x00\x00\x00\x00\x00\x00\x00, local.type=36, remote.type=36,
> local.settled=1, remote.settled=1, updated=0, current=0, writable=0,
> readable=0, work=0}}
> Continuing, by received one more message and also sending one to broker,
> there are now four Deliveries on the heap.
> {tag=, local.type=36, remote.type=0, local.settled=1, remote.settled=1,
> updated=0, current=0, writable=0, readable=0, work=0}
> {tag=\x00\x00\x00\x00\x00\x00\x00\x00, local.type=36, remote.type=36,
> local.settled=1, remote.settled=1, updated=0, current=0, writable=0,
> readable=0, work=0}
> {tag=, local.type=36, remote.type=0, local.settled=1, remote.settled=1,
> updated=0, current=0, writable=0, readable=0, work=0}
> {tag=\x01\x00\x00\x00\x00\x00\x00\x00, local.type=36, remote.type=36,
> local.settled=1, remote.settled=1, updated=0, current=0, writable=0,
> readable=0, work=0}
> And so on, until it eventually runs out of heap.
> I have done an extensive debug session, looking at the refcounts, behavior
> inside the pn_delivery_finalize(), places this gets called from, etc.
> One thing that hits the eye is the missing pn_full_settle() function, which
> is now replaced somehow differently by other code. Also, the tpwork-ers used
> to decref the Disposions, this is also modified for 0.9 (compared to 0.8).
> I'm not sure (yet) what is going on in there, it also might just be some
> error of mine (so I'm not immediately describing this as a bug, and I might
> provide more information as the situation unravels).
> At this moment, I would appreciate some hints on this topic, and also a
> review of the particular functionality (dispositon of Deliveries) in ProtonC
> 0.9.
> Thanks a lot !
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)