wuqian0808 opened a new pull request #428:
URL: https://github.com/apache/logging-log4j2/pull/428


   During reconfigure, LoggerContext will start new configuration and stop 
previous configuration. The firstime, prev is DefaultConfiguration, new 
configuration is eg: XmlConfiguration. Then the xml defined appender count in 
abstractmanager will be increased to 1. The nexttime reconfigure is called, xml 
defined appender count will be increased to 2. However the abstractmanager stop 
method will check if --count is <= 0. This cause the kafka producer thread 
never get stopped.
   
   So each time loggercontext config start, the kafkamanager will create new 
kafka producer thread although it has one producer instance already. And the 
producer thread will never get closed.
   
   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]


Reply via email to