From df196f1d27e75b4f82a35e368406910be16c75c6 Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Fri, 30 May 2014 16:24:58 +0000 Subject: QPID-5795: [Java Broker] Prevent ConnectionAdapter leak when closing a messaging connection The leak was due to the fact that nothing was telling the virtualhost to unregister the connection child (#unregisterChild) when the connection was closed. * Made ConnectionAdapter responsible for causing its own deletion (when the underlying connection is closed). The call to #deleted() causes the child to be unregistered from its parent (preventing the leak) * Removed the now unnecessary _connectionAdapters map from the VH. This needlessly duplicated information already held more generally by the ACO. * Refactored SessionAdapter in sympathy with CA changes. SessionsAdapters where _not_ being leaked as the session implementation were already telling the model to delete. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1598658 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java | 1 - .../main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java | 4 ---- 2 files changed, 5 deletions(-) (limited to 'qpid/java/broker-plugins') diff --git a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java index 6dd4124258..793150f9bb 100644 --- a/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java +++ b/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnectionDelegate.java @@ -299,7 +299,6 @@ public class ServerConnectionDelegate extends ServerDelegate stopAllSubscriptions(conn, dtc); Session ssn = conn.getSession(dtc.getChannel()); ((ServerSession)ssn).setClose(true); - ((ServerSession)ssn).getModelObject().delete(); super.sessionDetach(conn, dtc); } diff --git a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java index 1f108ec3e9..200be71187 100644 --- a/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java +++ b/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java @@ -739,10 +739,6 @@ public class AMQChannel> _transaction.rollback(); - if(_modelObject != null) - { - _modelObject.delete(); - } try { -- cgit v1.2.1