You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Mike Drob (Jira)" <ji...@apache.org> on 2020/03/26 18:23:00 UTC

[jira] [Commented] (SOLR-14351) Harden MDCLoggingContext.clear depth tracking

    [ https://issues.apache.org/jira/browse/SOLR-14351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17067931#comment-17067931 ] 

Mike Drob commented on SOLR-14351:
----------------------------------

As I was looking through the PR, I had an idea for a slightly different design decision...

 

If instead of null, be return an AutoCloseable, then we don't have to have developers remember to call clear at the end. And we would get compiler warnings where we miss it. Maybe it wouldn't work with the ThreadLocal and static context, but it might be worth exploring.

> Harden MDCLoggingContext.clear depth tracking
> ---------------------------------------------
>
>                 Key: SOLR-14351
>                 URL: https://issues.apache.org/jira/browse/SOLR-14351
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: David Smiley
>            Assignee: David Smiley
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> MDCLoggingContext tracks recursive calls and only clears when the recursion level is back down to 0.  If a caller forgets to register and ends up calling clear any ways, then this can mess things up.  Additionally I found at least one place this is occurring, which led me to investigate this matter.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org