mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3198 - unregister failed add connection but have unregister respect the reference count such that it is only removed if the refcount is 1
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1079885 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4f9784dafc
commit
f93d05acef
|
@ -43,6 +43,10 @@ public class MapTransportConnectionStateRegister implements TransportConnection
|
||||||
|
|
||||||
public TransportConnectionState unregisterConnectionState(ConnectionId connectionId) {
|
public TransportConnectionState unregisterConnectionState(ConnectionId connectionId) {
|
||||||
TransportConnectionState rc = connectionStates.remove(connectionId);
|
TransportConnectionState rc = connectionStates.remove(connectionId);
|
||||||
|
if (rc.getReferenceCounter().get() > 1) {
|
||||||
|
rc.decrementReference();
|
||||||
|
connectionStates.put(connectionId, rc);
|
||||||
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -697,6 +697,7 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
||||||
synchronized (brokerConnectionStates) {
|
synchronized (brokerConnectionStates) {
|
||||||
brokerConnectionStates.remove(info.getConnectionId());
|
brokerConnectionStates.remove(info.getConnectionId());
|
||||||
}
|
}
|
||||||
|
unregisterConnectionState(info.getConnectionId());
|
||||||
LOG.warn("Failed to add Connection " + info.getConnectionId() + ", reason: " + e.toString());
|
LOG.warn("Failed to add Connection " + info.getConnectionId() + ", reason: " + e.toString());
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("Exception detail:", e);
|
LOG.debug("Exception detail:", e);
|
||||||
|
|
Loading…
Reference in New Issue