lh0156 opened a new pull request, #23044:
URL: https://github.com/apache/kafka/pull/23044

   Closes KAFKA-19470
   
   ### Summary
   
   - Cache the immutable Scala logger wrapper by logger name in 
`kafka.utils.Logging`.
   - Preserve custom `loggerName` overrides by using the resolved name as the 
cache key.
   - Add a regression test proving that multiple instances with the same logger 
name share the wrapper.
   
   `Logging.logger` was previously initialized independently for every object 
instance. The underlying SLF4J logger is name-based, so the wrapper can be 
reused safely. A `ConcurrentHashMap` keeps the lookup thread-safe while 
allowing concurrent construction to converge on one cached wrapper.
   
   ### Tests
   
   - `./gradlew :core:test --tests kafka.utils.LoggingTest --no-build-cache 
--rerun-tasks --console=plain`
   - `./gradlew :core:spotlessCheck --no-build-cache --console=plain`
   
   The regression test was first verified to fail against the base branch, then 
passed after the cache implementation was added. Core Checkstyle and SpotBugs 
also passed as part of the test build.
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to