[JIRA] Created: (LBCLASSIC-70) Let the LogbackMDCAdapter exhibit a full copy on write semantics

Let the LogbackMDCAdapter exhibit a full copy on write semantics ---------------------------------------------------------------- Key: LBCLASSIC-70 URL: http://jira.qos.ch/browse/LBCLASSIC-70 Project: logback-classic Issue Type: Improvement Components: Other Affects Versions: 0.9.9, 0.9.10 Reporter: Szel Zoltan Assignee: Logback dev list Hi, I have implemented an async appender and i was very happy seeing that most of the methods of the MDCAdapter exhibits copy on write semantics. This is very handy in this scenerio, it helps to transfer the MDC map onto the background thread. But i have noticed, that the clear and setContextMap methods are breaking this semantics. Is there any chance in the next release to change the implementation of the clear and setContextMap to conform with cow? Thanks very much. P.S.: We are waiting for legal approval to contribute our appender implementation back to the community. Best Regards, Zoltan Szel -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-70?page=com.atlassian.jira.plugin.system... ] Ceki Gulcu resolved LBCLASSIC-70. --------------------------------- Fix Version/s: unspecified Resolution: Incomplete Hello Szel, Could you please propose a patch? I just looked at LogbackMDCAdapter and fail to understand what you are saying. In the mean time, I am marking this issue as resolved. Please also note that LogbackMDCAdapter now relies on the CopyOnInheritThreadLocal class which makes a copy of the parent data in child threads.
Let the LogbackMDCAdapter exhibit a full copy on write semantics ----------------------------------------------------------------
Key: LBCLASSIC-70 URL: http://jira.qos.ch/browse/LBCLASSIC-70 Project: logback-classic Issue Type: Improvement Components: Other Affects Versions: 0.9.9, 0.9.10 Reporter: Szel Zoltan Assignee: Logback dev list Fix For: unspecified
Hi, I have implemented an async appender and i was very happy seeing that most of the methods of the MDCAdapter exhibits copy on write semantics. This is very handy in this scenerio, it helps to transfer the MDC map onto the background thread. But i have noticed, that the clear and setContextMap methods are breaking this semantics. Is there any chance in the next release to change the implementation of the clear and setContextMap to conform with cow? Thanks very much. P.S.: We are waiting for legal approval to contribute our appender implementation back to the community. Best Regards, Zoltan Szel
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-70?page=com.atlassian.jira.plugin.system... ] Szel Zoltan commented on LBCLASSIC-70: -------------------------------------- Hello Ceki, the problem relies in the clear() and setContextMap() methods. Both of them destorys the original map, which in my situation is assigned to LoggingEvents sitting in a queue and waiting for to be processed. Neither of this method should change the content of the original map. Proposed solution: public void clear() { copyOnInheritThreadLocal.remove(); } public void setContextMap(Map contextMap) { HashMap<String, String> newMap = new HashMap<String, String>(); newMap.putAll(contextMap); copyOnInheritThreadLocal.set(newMap); } } l
Let the LogbackMDCAdapter exhibit a full copy on write semantics ----------------------------------------------------------------
Key: LBCLASSIC-70 URL: http://jira.qos.ch/browse/LBCLASSIC-70 Project: logback-classic Issue Type: Improvement Components: Other Affects Versions: 0.9.9, 0.9.10 Reporter: Szel Zoltan Assignee: Logback dev list Fix For: unspecified
Hi, I have implemented an async appender and i was very happy seeing that most of the methods of the MDCAdapter exhibits copy on write semantics. This is very handy in this scenerio, it helps to transfer the MDC map onto the background thread. But i have noticed, that the clear and setContextMap methods are breaking this semantics. Is there any chance in the next release to change the implementation of the clear and setContextMap to conform with cow? Thanks very much. P.S.: We are waiting for legal approval to contribute our appender implementation back to the community. Best Regards, Zoltan Szel
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-70?page=com.atlassian.jira.plugin.system... ] Ceki Gulcu reopened LBCLASSIC-70: ---------------------------------
Let the LogbackMDCAdapter exhibit a full copy on write semantics ----------------------------------------------------------------
Key: LBCLASSIC-70 URL: http://jira.qos.ch/browse/LBCLASSIC-70 Project: logback-classic Issue Type: Improvement Components: Other Affects Versions: 0.9.9, 0.9.10 Reporter: Szel Zoltan Assignee: Logback dev list Fix For: unspecified
Hi, I have implemented an async appender and i was very happy seeing that most of the methods of the MDCAdapter exhibits copy on write semantics. This is very handy in this scenerio, it helps to transfer the MDC map onto the background thread. But i have noticed, that the clear and setContextMap methods are breaking this semantics. Is there any chance in the next release to change the implementation of the clear and setContextMap to conform with cow? Thanks very much. P.S.: We are waiting for legal approval to contribute our appender implementation back to the community. Best Regards, Zoltan Szel
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-70?page=com.atlassian.jira.plugin.system... ] Ceki Gulcu resolved LBCLASSIC-70. --------------------------------- Resolution: Won't Fix Hello again, I consider the hashmap placed into the LogbackMDCAdapter via the MDC as owned by logback which should be able to discard it if necessary. Consequently, this issue is marked as "Resolved Won't fix". I am sorry for not yielding to your request.
Let the LogbackMDCAdapter exhibit a full copy on write semantics ----------------------------------------------------------------
Key: LBCLASSIC-70 URL: http://jira.qos.ch/browse/LBCLASSIC-70 Project: logback-classic Issue Type: Improvement Components: Other Affects Versions: 0.9.9, 0.9.10 Reporter: Szel Zoltan Assignee: Logback dev list Fix For: unspecified
Hi, I have implemented an async appender and i was very happy seeing that most of the methods of the MDCAdapter exhibits copy on write semantics. This is very handy in this scenerio, it helps to transfer the MDC map onto the background thread. But i have noticed, that the clear and setContextMap methods are breaking this semantics. Is there any chance in the next release to change the implementation of the clear and setContextMap to conform with cow? Thanks very much. P.S.: We are waiting for legal approval to contribute our appender implementation back to the community. Best Regards, Zoltan Szel
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
participants (2)
-
Ceki Gulcu (JIRA)
-
Szel Zoltan (JIRA)