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

David Smiley commented on SOLR-14351:
-------------------------------------

I played with this idea a bit locally.  Two issues:
* a try-with-resources demands you declare a local variable to store the 
AutoCloseable thing.  That means we need to declare an instance of something 
that's AutoCloseable and give it a name.
* AutoCloseable.close declares it throws Exception.  To avoid the caller seeing 
this, we'd want to perhaps have MDCLoggingContext implement AutoCloseable and 
declare close but not throw an exception.

I wonder if CoreContainer.getCore ought to bump the logging context? since it's 
ref-counted and thus could clear on close.   Hmmmm

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to