gdziadkiewicz commented on issue #292:
URL: 
https://github.com/apache/logging-log4net/issues/292#issuecomment-4341641838

   b) I'm reluctant to go for ` lock (_loggers)` for creating a log due to two 
reasons:
   1. Even with the proposed lock in `GetLogger` it is still possible to get an 
unregistered logger for a brief moment by intervening `GetLogger` and 
`Hierarchy.Exists` calls. This is due to the fact that the biggest crime of 
`GetLogger` is, IMO, inserting a not-yet-registered logger into the dict making 
it accessible for others.
   2. The users are allowed to use as many loggers with mix of same and 
different names as they want and making creation of x independent loggers at 
the same time sequential would slow them down, especially if they start it up 
all at once.
   
   I'm reviewing my lockless solution with Copilot in 
https://github.com/gdziadkiewicz/logging-log4net/pull/4 (please take a look if 
interested) and, given no major issues from testing or review, expect to create 
the real PR to main repo today. Expect an explanation in description of the PR 
why I believe this will handle both the problem highlighted in this issue and 
the dotted loggers. I also added the repro as test to prevent regression in 
future.
   
   Logger name specific locks you mentioned would not suffer from those issues. 
I will investigate that alternative too.


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