You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Clebert Suconic (Jira)" <ji...@apache.org> on 2025/03/13 01:55:00 UTC
[jira] [Closed] (ARTEMIS-5241) Remove useless validation for cluster-connection confirmation-window-size
[ https://issues.apache.org/jira/browse/ARTEMIS-5241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Clebert Suconic closed ARTEMIS-5241.
------------------------------------
> Remove useless validation for cluster-connection confirmation-window-size
> -------------------------------------------------------------------------
>
> Key: ARTEMIS-5241
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5241
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.39.0
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.40.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When a Core client reconnects to a broker it may resend packets which it had already sent but to which it had not yet received a reply. The number of packets resent depends on the {{confirmationWindowSize}}.
> If the resent packets include a client message then that might result in a duplicate message on the broker. To mitigate this risk we have duplicate detection. The broker will compare a special ID set on incoming messages to a cache of IDs which it has already received. The size of this broker-size cache is configured via {{id-cache-size}}.
> Putting these two things together one can see how the configuration of {{confirmationWindowSize}} and {{id-cache-size}} need to be coordinated to ensure no messages are duplicated. For example, if the {{confirmationWindowSize}} is so large that it holds more client messages than the {{id-cache-size}} the duplicates may occur.
> The method {{checkoutDupCacheSize}} on {{org.apache.activemq.artemis.core.config.impl.ConfigurationImpl}} is meant to help with this coordination for cluster connections, but this method appears to be useless for at least two reasons:
> # It compares the configuration of the cluster-connection's confirmation window size with the {{id-cache-size}} of the _local_ broker. However, the {{id-cache-size}} of the local broker is meaningless for the cluster-connection. It would need to compare the confirmation window size with the {{id-cache-size}} of the _remote_ broker to actually coordinate effectively.
> # It has a bug which causes spurious {{WARN}} messages like this to be logged:
> {quote}WARN [org.apache.activemq.artemis.core.server] (Thread-1 (ActiveMQ-client-global-threads)) AMQ224078: The size of duplicate cache detection (<id_cache-size/>) appears to be too large 2,000. It should be no greater than the number of messages that can be squeezed into confirmation window buffer (<confirmation-window-size/>) 10,485,760.{quote}
> # In order to calculate how many client messages might be in the confirmation window the logic uses a relatively arbitrary "default" message size. However, if the actual size of the messages is different from this then the {{WARN}} message will be incorrect and unhelpful.
> Considering all this the {{checkoutDupCacheSize}} method and all directly related code should be removed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact