[logback-dev] [qos-ch/logback] fd9006: ongoing work on LOGBACK-1509

Ceki Gülcü ceki at qos.ch
Sun Aug 8 18:39:03 CEST 2021


Hi Mike,

Thank you for your message as well as PR 477.

Please have a look at the code (commit 135bb88cd87e2c9 or later). Note 
that the viaCache(String) method is synchronized. It is the only place 
where the cache, a subclass of LinkedHashMap, is modified. It can be 
cleared via a call to disableCache() but this method may be called 
indirectly from within viaCache(String).

Thus, I think the implementation is quite thread safe.

You mentioned a lock free solution as well as solutions limiting memory 
usage. I am all ears.

--
Ceki

On 08/08/2021 17:49, mike.skells at talk21.com wrote:
> Hi
> Its good to see the work on this issue progressing, however there was a solution ready in https://github.com/qos-ch/logback/pull/477 for review, which has been working in a very large closed source systems for over a year now
> The fix that is not in master seems not to be threadsafe though. LinkedHashMap on which it is based isn't and that why I used CHM
> Maintaining a threadsafe no blocking LRU is complex, so I would suggest that to implementation in master is at least synchronized
> 
> I an happy to work on a better lock free solution though, but I am unconvinced that we need to have a limit on the size, and there are simpler approaches to limiting the growth if memory constraints are the concern
> 
> Regards
> Mike
> 
> -----Original Message-----
> From: logback-dev <logback-dev-bounces at qos.ch> On Behalf Of Ceki Gulcu
> Sent: 07 August 2021 22:08
> To: logback-dev at qos.ch
> Subject: [logback-dev] [qos-ch/logback] fd9006: ongoing work on LOGBACK-1509
> 
>    Branch: refs/heads/master
>    Home:   https://github.com/qos-ch/logback
>    Commit: fd9006981ac7ff52fbc79187254b1f3c1bd70bf8
>        https://github.com/qos-ch/logback/commit/fd9006981ac7ff52fbc79187254b1f3c1bd70bf8
>    Author: Ceki Gulcu <ceki at qos.ch>
>    Date:   2021-08-07 (Sat, 07 Aug 2021)
> 
>    Changed paths:
>      M logback-classic/src/main/java/ch/qos/logback/classic/pattern/NamedConverter.java
>      M logback-classic/src/test/java/ch/qos/logback/classic/pattern/LoggerNameConverterPerfTest.java
> 
>    Log Message:
>    -----------
>    ongoing work on LOGBACK-1509
> 
> Signed-off-by: Ceki Gulcu <ceki at qos.ch>
> 
> 
> _______________________________________________
> logback-dev mailing list
> logback-dev at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-dev
> 
> _______________________________________________
> logback-dev mailing list
> logback-dev at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-dev
> 


More information about the logback-dev mailing list