qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clifford Jansen (Jira)" <j...@apache.org>
Subject [jira] [Commented] (QPID-8397) Memory leak in QueueBindings list
Date Mon, 06 Jan 2020 07:41:00 GMT

    [ https://issues.apache.org/jira/browse/QPID-8397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17008596#comment-17008596

Clifford Jansen commented on QPID-8397:

Trial fix in [https://github.com/cliffjansen/qpid-cpp]  (QPID-8397 branch).


This patch introduces a Queue::unbound() method as the Queue::bound() counterpart and matches
its use with exchange unbind() operations.

> Memory leak in QueueBindings list
> ---------------------------------
>                 Key: QPID-8397
>                 URL: https://issues.apache.org/jira/browse/QPID-8397
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: qpid-cpp-1.40.0
>            Reporter: Clifford Jansen
>            Assignee: Clifford Jansen
>            Priority: Major
> The Queue remembers the bindings it belongs to in its QueueBindings class. There is an
add() but no corresponding remove() method. If repeated bind and unbind operations are done
in succession (between the same exchange-queue pair), duplicates pile up in the QueueBindings
but not in the exchange binding list.
> The remembered QueueBindings are only ever actively used in two cases: a simple unit_test
case and on deletion of the Queue to free its resources, including bindings. Neither case
suffers from working with duplicates, aside from the memory waste while the queue is alive.
Memory is reclaimed when the queue is destroyed, so valgrind is happy.
> However, some usage patterns can allow many duplicates to accumulate. See
> https://bugzilla.redhat.com/show_bug.cgi?id=1778703
> There is more than one mechanism used within the broker to create a binding:
> Exchange::bind() + Queue::bound()
> Queue::bind() which essentially does the former
> To fix this leak without a refactor, both forms needs to be located in the code and symmetric
"unbind" operations need to deallocate the QueueBindings reference.

This message was sent by Atlassian Jira

To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org

View raw message