This closes #2780
This commit is contained in:
commit
8d7831a838
|
@ -1039,6 +1039,10 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
|
||||
remotingConnection.removeFailureListener(cleaner);
|
||||
}
|
||||
|
||||
if (server.getAddressInfo(unPrefixedQueueName) == null) {
|
||||
targetAddressInfos.remove(queueToDelete);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1876,7 +1880,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
connectionFailed(me, failedOver);
|
||||
}
|
||||
|
||||
private Map<SimpleString, Pair<Object, AtomicLong>> cloneTargetAddresses() {
|
||||
public Map<SimpleString, Pair<Object, AtomicLong>> cloneTargetAddresses() {
|
||||
return new HashMap<>(targetAddressInfos);
|
||||
}
|
||||
|
||||
|
|
|
@ -227,6 +227,25 @@ public class TemporaryDestinationTest extends JMSTestBase {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForTempQueueTargetInfosLeak() throws Exception {
|
||||
try {
|
||||
conn = createConnection();
|
||||
Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
TemporaryQueue temporaryQueue = s.createTemporaryQueue();
|
||||
MessageProducer producer = s.createProducer(temporaryQueue);
|
||||
producer.send(s.createMessage());
|
||||
temporaryQueue.delete();
|
||||
for (ServerSession serverSession : server.getSessions()) {
|
||||
assertFalse(((ServerSessionImpl)serverSession).cloneTargetAddresses().containsKey(SimpleString.toSimpleString(temporaryQueue.getQueueName())));
|
||||
}
|
||||
} finally {
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForSecurityCacheLeak() throws Exception {
|
||||
server.getSecurityStore().setSecurityEnabled(true);
|
||||
|
|
Loading…
Reference in New Issue