[
https://issues.apache.org/jira/browse/ARTEMIS-4523?focusedWorklogId=893770&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-893770
]
ASF GitHub Bot logged work on ARTEMIS-4523:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 04/Dec/23 13:58
Start Date: 04/Dec/23 13:58
Worklog Time Spent: 10m
Work Description: clebertsuconic commented on code in PR #4700:
URL: https://github.com/apache/activemq-artemis/pull/4700#discussion_r1413912177
##########
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java:
##########
@@ -244,18 +244,15 @@ public void nodeDown(long eventUID, String nodeID) {
}
}
- public void removeConnection(ConnectionInfo info, Throwable error) throws
InvalidClientIDException {
- String clientId = info.getClientId();
- if (clientId != null) {
- AMQConnectionContext context = this.clientIdSet.remove(clientId);
- if (context != null) {
- //connection is still there and need to close
- context.getConnection().disconnect(error != null);
- this.connections.remove(context.getConnection());
+ public void removeConnection(String clientID, OpenWireConnection
connection) {
+ synchronized (clientIdSet) {
Review Comment:
@gtully I had a check if the connection being removed was the original
connection.
Since ConcurrentHashMap has a remove(key, value), and only removing it if
the value is that value, then I can remove the sync point and use a
concurrentHashMap.
The only race is the remove.. since we should always put it on the
addConnection.
Issue Time Tracking
-------------------
Worklog Id: (was: 893770)
Time Spent: 1h 50m (was: 1h 40m)
> Failover leaving consumers and producers behind
> -----------------------------------------------
>
> Key: ARTEMIS-4523
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4523
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.31.2
> Reporter: Clebert Suconic
> Assignee: Clebert Suconic
> Priority: Major
> Fix For: 2.32.0
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> Failover in OpenWire could leave consumers, producers and internal sessions
> hanging behind.
> If the failover happened in a race condition where the new connection
> (reconnection) happened before the client failure.. you could end with
> consumers without connections.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)