wuqian0808 commented on pull request #425: URL: https://github.com/apache/logging-log4j2/pull/425#issuecomment-698699334
> I tried your case, and you are right, the KafkaAppender do have the problem of thead leak. But **close when startup** is not the correct way to solve this problem. Try to find why the **count in abstractmanager** increase each time when reconfigure(), fix it and make sure the kafkaManager close when prev.stop(). You'd better open an [issue](https://issues.apache.org/jira/browse/LOG4J2) to track this problem. And if you can provide unit test that failed without your PR, and success with your PR, it will help a lot to make this PR accepted ASAP. The count is correct. It means the count of appenders using this manager. As we can see, the AbstarctManager will store a map of all static log4j2 managers. So during reconfigure, if managers is used by new config, the manager shouldn't be closed. Instead I just added a logic to check whether new kafka thread should be opended. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
