[logback-dev] [JIRA] Updates for LOGBACK-1684: Unnecessary synchronization in LogbackMDCAdapter

QOS.CH (JIRA) noreply-jira at qos.ch
Sat Sep 24 12:18:00 CEST 2022


logback / LOGBACK-1684 [Open]
Unnecessary synchronization in LogbackMDCAdapter

==============================

Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.

View or comment on issue using this link
https://jira.qos.ch/browse/LOGBACK-1684

==============================
 Issue created
------------------------------

Sami Korhonen created this issue on 24/Sep/22 12:04 PM
Summary:              Unnecessary synchronization in LogbackMDCAdapter
Issue Type:           Improvement
Assignee:             Logback dev list
Components:           logback-classic
Created:              24/Sep/22 12:04 PM
Labels:               Performance
Priority:             Major
Reporter:             Sami Korhonen
Description:
  LogbackMDCAdapter uses synchronization. Synchronization has been added to fix problems related to use of inheritable thread local (LOGBACK-434) Inheritable thread local was removed in commit aa7d584ecdb1638bfc4c7223f4a5ff92d5ee6273 to fix issues LOGBACK-422 and LOGBACK-624. Synchronization was not removed
  
  It seems that synchronization and clever use of atomicinteger are no longer required. Logback exposes MDC variables only using single value getter and a method that returns a copy.
  
  Removing synchronization could have significant impact on situations where you need to update MDC often. One such use case is reactive java, that requires one to update MDC between every task that logs.
  
  Synchronization does also cause problems with project loom. 


==============================
 This message was sent by Atlassian Jira (v8.8.0#808000-sha1:e2c7e59)



More information about the logback-dev mailing list