Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-784

Settled Deliveries keep piling up, and do not seem to get freed from heap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • proton-0.9
    • proton-0.9
    • proton-c
    • None

    Description

      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)

      Attachments

        Activity

          People

            Unassigned Unassigned
            E528527 German Shepherd (PrE)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: