[ 
https://issues.apache.org/jira/browse/ARTEMIS-4626?focusedWorklogId=903041&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-903041
 ]

ASF GitHub Bot logged work on ARTEMIS-4626:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Feb/24 13:58
            Start Date: 01/Feb/24 13:58
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #4797:
URL: https://github.com/apache/activemq-artemis/pull/4797#discussion_r1474518475


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/internal/FederationQueueEntry.java:
##########
@@ -28,19 +33,19 @@
  * on a federation resource such that it is not torn down until all demand has 
been
  * removed from the local resource.
  */
-public class FederationConsumerEntry {
+public class FederationQueueEntry {
 
    private final FederationConsumerInternal consumer;
 
-   private int references = 1;
+   private final Set<String> consumerDemand = new HashSet<>();

Review Comment:
   I was wondering why you didn't just use a HashSet of ServerConsumers here.
   
   But I guess this is better since it decreases chances of memory leaking? if 
you forgot an entry here at least you wouldn't leak the consumer->connection 
and everything associated with it?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 903041)
    Time Spent: 0.5h  (was: 20m)

> AMQP Federation demand tracking can overcount demand
> ----------------------------------------------------
>
>                 Key: ARTEMIS-4626
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4626
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP
>    Affects Versions: 2.32.0
>            Reporter: Timothy A. Bish
>            Assignee: Timothy A. Bish
>            Priority: Major
>             Fix For: 2.33.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The demand tracking for Address bindings and Queue consumers that controls 
> when a federation consumer is created and destroyed can race on start of 
> federation with consumers or bindings being added and removed and over count 
> the demand leading to the federation consumers not being shutdown when demand 
> on the local broker drops to zero.  A better mechanism of tracking needs to 
> be added to make demand tracking idempotent for additions and removals of 
> local demand and the startup demand checks



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to