tristantarrant commented on issue #3399:
URL: 
https://github.com/apache/logging-log4j2/issues/3399#issuecomment-2622169191

   Neither of those suggestions improved things. However I have some additional 
info.
   I've put some good old `System.out.printf`s around the write lock code. Here 
is an example of things going well:
   ```
   writeLock - ask - 
org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifierImpl, 
org.apache.logging.log4j.message.ReusableMessageFactory@6dab9b6d
   writeLock - acquire - 
org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifierImpl, 
org.apache.logging.log4j.message.ReusableMessageFactory@6dab9b6d
   writeLock - ret - 
org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifierImpl, 
org.apache.logging.log4j.message.ReusableMessageFactory@6dab9b6d / 
c=org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifierImpl:DEBUG
 in Default 
n=org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifierImpl:DEBUG
 in Default
   writeLock - release - 
org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifierImpl, 
org.apache.logging.log4j.message.ReusableMessageFactory@6dab9b6d
   ```
   
   the `ret` part is what is being returned: `c` is the `currentLogger` and `n` 
is the `newLogger`.
   
   Here is an example when bad things start happening. I get 100s of the 
following:
   
   ```
   writeLock - ask - org.infinispan.LIFECYCLE, 
org.apache.logging.log4j.message.ReusableMessageFactory@6dab9b6d
   writeLock - acquire - org.infinispan.LIFECYCLE, 
org.apache.logging.log4j.message.ReusableMessageFactory@6dab9b6d
   writeLock - ret - org.infinispan.LIFECYCLE, 
org.apache.logging.log4j.message.ReusableMessageFactory@6dab9b6d / c=null 
n=org.infinispan.LIFECYCLE:DEBUG in Default
   writeLock - release - org.infinispan.LIFECYCLE, 
org.apache.logging.log4j.message.ReusableMessageFactory@6dab9b6d
   ```
   
   The Weak semantics are causing it to not find the entry in the map, so every 
single request for the `org.infinispan.LIFECYCLE` acquires the write lock, 
skipping the "fast path".
   Changing the `loggerRefByNameByMessageFactory` to use a normal HashMap and 
removing the WeakReferences fixes the issue.
   


-- 
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: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to