[
https://issues.apache.org/jira/browse/AMQ-9692?focusedWorklogId=1001865&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1001865
]
ASF GitHub Bot logged work on AMQ-9692:
---------------------------------------
Author: ASF GitHub Bot
Created on: 26/Jan/26 20:20
Start Date: 26/Jan/26 20:20
Worklog Time Spent: 10m
Work Description: cshannon commented on code in PR #1484:
URL: https://github.com/apache/activemq/pull/1484#discussion_r2729113503
##########
activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java:
##########
@@ -260,16 +260,21 @@ protected List<Subscription>
addSubscriptionsForDestination(ConnectionContext co
}
@Override
- public void removeDestination(ConnectionContext context,
ActiveMQDestination destination, long timeout)
- throws Exception {
-
+ public void removeDestination(ConnectionContext context,
ActiveMQDestination destination, long timeout) throws Exception {
// No timeout.. then try to shut down right way, fails if there are
// current subscribers.
if (timeout == 0) {
for (Iterator<Subscription> iter =
subscriptions.values().iterator(); iter.hasNext();) {
Subscription sub = iter.next();
if (sub.matches(destination) ) {
- throw new JMSException("Destination: " + destination + "
still has an active subscription: " + sub);
+ if(sub.isWildcard()) {
+ var dest = destinations.get(destination);
+ if(dest != null &&
dest.isGcWithOnlyWildcardConsumers()) {
Review Comment:
isActive() and canGC() are a bit different because they also check for
active producers. I'm not entirely sure why the method to remove was written
not to care about producers, maybe an oversight, but changing that now would be
a behavior change that could cause some side effects that are unexpected.
Re-using logic is good but maybe it just needs to be subdivided to only check
for active consumers (that method already exists and isActive() calls it now).
As you pointed out, the RegionBroker calls this to delete the destination
but already after the gc check so we know there are no active
consumer/producers. So the real question is whether or not we care about
blocking a manual deletion through JMX if there are active producers. It seems
odd to not check that but changing that now as I said is a behavior change that
could break someone's use case. (I suppose i could see someone wanting to block
deletes with active consumers but not subscribers).
Your point about it not checking the gcWithNetworkConsumers flag is valid
and probably a bug. In fact it proves the point that we should be sharing the
logic because the GC automated check will check it but not the manual deletion.
Issue Time Tracking
-------------------
Worklog Id: (was: 1001865)
Time Spent: 3h (was: 2h 50m)
> Support destination gc sweep of destinations with wild card consumers
> ---------------------------------------------------------------------
>
> Key: AMQ-9692
> URL: https://issues.apache.org/jira/browse/AMQ-9692
> Project: ActiveMQ
> Issue Type: Improvement
> Reporter: Matt Pavlovich
> Assignee: Matt Pavlovich
> Priority: Minor
> Fix For: 6.3.0, 5.19.2
>
> Time Spent: 3h
> Remaining Estimate: 0h
>
> Currently, a wild-card consumer can hold up a destination from being
> automatically garbage collected. This change would add a policyEntry setting
> to allow garbage collection if the destination only has wild card consumers
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact