[
https://issues.apache.org/jira/browse/ARTEMIS-4286?focusedWorklogId=862199&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-862199
]
ASF GitHub Bot logged work on ARTEMIS-4286:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 23/May/23 17:37
Start Date: 23/May/23 17:37
Worklog Time Spent: 10m
Work Description: jbertram commented on code in PR #4485:
URL: https://github.com/apache/activemq-artemis/pull/4485#discussion_r1202765509
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedQueueConsumerImpl.java:
##########
@@ -129,22 +144,26 @@ private void connect() throws Exception {
throw new ActiveMQNonExistentQueueException("Queue " +
key.getQueueName() + " does not exist on remote");
}
}
- }
- } catch (Exception e) {
- try {
- if (clientSessionFactory != null) {
- clientSessionFactory.cleanup();
+ } catch (Exception e) {
+ try {
+ if (clientSessionFactory != null) {
+ clientSessionFactory.cleanup();
+ }
+ disconnect();
+ } catch (ActiveMQException ignored) {
}
- disconnect();
- } catch (ActiveMQException ignored) {
+ throw e;
}
- throw e;
}
}
@Override
- public void close() {
- scheduleDisconnect(0);
+ public synchronized void close() {
+ if (started) {
+ started = false;
+ currentConnectTask.cancel(true);
Review Comment:
Fair enough.
Issue Time Tracking
-------------------
Worklog Id: (was: 862199)
Time Spent: 3h (was: 2h 50m)
> Sometimes federated consumer won't stop
> ---------------------------------------
>
> Key: ARTEMIS-4286
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4286
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Time Spent: 3h
> Remaining Estimate: 0h
>
> If a federated consumer is in the process of connecting when it's closed it
> won't actually close. It will keep attempting to connect and once it actually
> connects it will operate as if it was never closed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)