[ 
https://issues.apache.org/jira/browse/AMQ-4666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14269399#comment-14269399
 ] 

Tim Bain commented on AMQ-4666:
-------------------------------

What's unexpected about this?  You set a limit on how much space messages can 
take up in a single destination, you send enough messages to reach/pass that 
limit, and the broker flow controls you until one or more of those messages are 
consumed.  This is all by design; where's the bug?

> Topic persistent message publishing is blocked by hitting 100% of 
> per-destination memory limit if there's any durable subscriber connected but 
> not consuming.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-4666
>                 URL: https://issues.apache.org/jira/browse/AMQ-4666
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.7.0
>            Reporter: Jaewoong Choi
>         Attachments: MemoryLimitTest.java
>
>
> Failing scenario:
> 1. Embedded broker starts with the following configurations:
>    - persistent = true,
>    - systemUsage.memoryUsage.limit = 10*1024*1024 // 10mb broker main memory 
> limit
>    - destinationPolicy.policyEntry.memoryLimit = 1*1024*1024 // 1mb 
> per-destination memory limit
> 2. Create a topic durable subscription with prefetchLimit=0.
> 3. Create a topic publisher and publish persistent 400kb messages.
> 4. (Problem) After publishing 3 messages successfully, PFC kicks in and the 
> above topic publisher gets blocked its publishing.
> At step #4, the expectation is not seeing any publisher blocking for the 
> persistent message publishing until the store limit is reached.  How come the 
> persistent message publishing is limited by 100% memory full?
> Per the code inspection, this is because the store cursor of the topic 
> durable subscriber (i.e. TopicStorePrefetch) is working with the main 
> broker's memory limit, not with the per-destination memory limit.  Hence, it 
> keeps increasing broker main memory usage over the per-destination memory 
> limit and after it reached 100% of per-destination limit, PFC kicked in.
> I verified that the above scenario went through well if I fix the store 
> cursor to use/refer-to the per-destination memory usage along with its 
> pending list (cache) management.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to