qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Rudyy (Jira)" <j...@apache.org>
Subject [jira] [Created] (QPID-8433) [Broker-J][7.0.x] LastValueQueueList can leak deleted queue entries
Date Fri, 03 Apr 2020 10:14:00 GMT
Alex Rudyy created QPID-8433:

             Summary: [Broker-J][7.0.x] LastValueQueueList can leak deleted queue entries
                 Key: QPID-8433
                 URL: https://issues.apache.org/jira/browse/QPID-8433
             Project: Qpid
          Issue Type: Bug
          Components: Broker-J
    Affects Versions: 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28,
0.29, 0.30, 0.31, 0.32, qpid-java-6.0, qpid-java-6.0.1, qpid-java-6.0.2, qpid-java-6.0.3,
qpid-java-6.0.4, qpid-java-6.0.5, qpid-java-6.1, qpid-java-6.0.6, qpid-java-6.1.1, qpid-java-6.1.2,
qpid-java-6.0.7, qpid-java-6.1.3, qpid-java-6.0.8, qpid-java-6.1.4, qpid-java-broker-7.0.0,
qpid-java-6.1.5, qpid-java-broker-7.0.1, qpid-java-6.1.7, qpid-java-broker-7.1.0, qpid-java-broker-7.0.4,
qpid-java-broker-7.0.5, qpid-java-broker-7.0.6, qpid-java-broker-7.0.7, qpid-java-broker-7.1.1,
qpid-java-broker-7.1.2, qpid-java-broker-7.0.8, qpid-java-broker-7.1.3, qpid-java-broker-7.1.4
            Reporter: Alex Rudyy
            Assignee: Alex Rudyy
             Fix For: qpid-java-broker-7.1.6

Qpid Broker-j can run out of heap memory due to leaking  deleted LVQ  entries via {{LastValueQueueList#_latestValuesMap}}.

The deleted queue entry can be left in {{LastValueQueueList#_latestValuesMap}} in result of
race between enqueing thread and consuming or management thread, where entry is deleted. An
LVQ entry is removed from {{LastValueQueueList#_latestValuesMap}}, when {{_latestValueReference}}
is set on the entry as part of invocation {{LastValueQueueList#add(...)}}. If {{_latestValueReference}}
is not set in result of unfortunate thread scheduling, the LVQ entry might not be removed
from the {{LastValueQueueList#_latestValuesMap}} as part of invocation of {{LastValueQueueList$ConflationQueueEntry#onDelete}}.

In some unlucky circumstances the deleted entry can hold a reference to another deleted entry.
They can makes a chain of deleted entries, which is referenced from {{LastValueQueueList#_latestValuesMap}}.
The latter prevents the Garbage Collector from freeing the memory occupied by the chain of
deleted entries.

The solution for this problem seems require adding into {{LastValueQueueList#add(...)}} after
setting of {{LastValueQueueList$ConflationQueueEntry#_latestValueReference}}  a call to {{LastValueQueueList$ConflationQueueEntry#onDelete}},
when the entry state is {{DELETED}}.

The reason why deleted LVQ entries remained linked together is not clear yet.

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