[ 
https://issues.apache.org/jira/browse/PROTON-784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14257524#comment-14257524
 ] 

Chuck Rolke commented on PROTON-784:
------------------------------------

A simple reproducer is available in the Qpid messaging examples. Add 
{noformat}
diff --git a/qpid/cpp/examples/messaging/client.cpp 
b/qpid/cpp/examples/messaging/client.cpp
index d695dd9..f580d45 100644
--- a/qpid/cpp/examples/messaging/client.cpp
+++ b/qpid/cpp/examples/messaging/client.cpp
@@ -61,12 +61,18 @@ int main(int argc, char** argv) {
 
        Message request;
         request.setReplyTo(responseQueue);
+        for (int j=0; j<5000; j++) {
+            std::cout << "pass " << j << std::endl;
+            if (1250 == j) {
+                std::cout << "Break here. Next transmit won't go" << std::endl;
+            }
        for (int i=0; i<4; i++) {
             request.setContentObject(s[i]);
             sender.send(request);
             Message response = receiver.fetch();
             std::cout << request.getContentObject() << " -> " << 
response.getContentObject() << std::endl;
        }
+        }
         connection.close();
         return 0;
     } catch(const std::exception& error) {
{noformat}

The oddball 1250 comes from a limit set in cpp/src/qpid/broker/amqp/Outgoing.cpp
    ..., deliveries(5000), ...
Deliveries are supposed to come back from proton through 
OutgoingFromQueue::handle
but that function is never called.

> 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 (PrE)
>             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 
> Deliveries 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 !
> (minor edit - text formatting - on 12/21/2014)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to