Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.1.3
-
Tomcat 7.0.35
ActiveMQ 5.10.0
Description
When a JMS appender is stopping, it only closes its JMS connection if started equals true. See link below
https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/net/JMSTopicAppender.java#L140
https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/net/JMSQueueAppender.java#L140
However, in the appender start method, if anything goes wrong after the JMS connection is created (in my case, failed to lookup a topic from JNDI), then the appender, which already has a JMS connection, will not be started. When the appender stops, the JMS connection will not be closed.
A JMS connection, once created, even if not started, may have resources (e.g. thread, thread pool, socket connection) allocated to it. Therefore, if not closed correctly, will cause resource leak.