On Fri, 14 Jan 2022 at 13:59, Gordon Sim <[email protected]> wrote: > On Fri, Jan 14, 2022 at 10:36 AM Pete Fawcett <[email protected]> wrote: > > I tried this but it didn't, initially, fix the problem. > > It turns out that the current exception handling is causing the link to > be > > closed from within Connection object doDeliveryUpdated > > < > https://github.com/apache/qpid-cpp/blob/main/src/qpid/broker/amqp/Connection.cpp#L675 > > > > Calling Session::abort_pending() from there meant changing > abort_pending() > > to be a public function, which makes me wonder if it is the right thing > to > > be doing. > > Making the change, and calling abort_pending() before closing the link in > > doDeliveryUpdated, did remove the pending items and so prevent the > Segfault. > > You could also put a try/catch in Session::readable[1], and call > abort_pending before rethrowing. (Or later, send back a nack for the > message instead of rethrowing for certain errors). > > [1] > https://github.com/apache/qpid-cpp/blob/main/src/qpid/broker/amqp/Session.cpp#L697 > > Thank you for that helpful suggestion, Gordon. Adding the suggested try/catch allowed the abort_pending to be called in the correct place and so cleared up the pending deliveries before they could cause a segfault.
I would like to go on now, as originally stated, and change the behaviour when the 'reject' queue is full, so that the message is 'returned' rather than dropping the link. (I believe this is what happens when using AMQP 0.10) Would you prefer that I submit a Pull Request for the current fixes or wait until further changes are made? Thanks Pete
