You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/02/01 04:36:04 UTC

[GitHub] [solr] dsmiley opened a new pull request #583: SOLR-14686: fix MDC log clear in SolrCore.close

dsmiley opened a new pull request #583:
URL: https://github.com/apache/solr/pull/583


   https://issues.apache.org/jira/browse/SOLR-14686
   
   Fixing my mistake.  Ensure MDC is cleared right before this method returns.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [solr] madrob commented on a change in pull request #583: SOLR-14686: fix MDC log clear in SolrCore.close

Posted by GitBox <gi...@apache.org>.
madrob commented on a change in pull request #583:
URL: https://github.com/apache/solr/pull/583#discussion_r797231013



##########
File path: solr/core/src/java/org/apache/solr/core/SolrCore.java
##########
@@ -1573,13 +1573,20 @@ public void open() {
    */
   @Override
   public void close() {
-    int count = refCount.decrementAndGet();
-    if (count > 0) return; // close is called often, and only actually closes if nothing is using it.

Review comment:
       I kind of like the comment here explaining that close is called often and I'll be a little sad about losing it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [solr] madrob commented on pull request #583: SOLR-14686: fix MDC log clear in SolrCore.close

Posted by GitBox <gi...@apache.org>.
madrob commented on pull request #583:
URL: https://github.com/apache/solr/pull/583#issuecomment-1027071784


   An alternative idea would be to move the current implementation of close to `_close` and then the new implementation of public close would be `try { _close() } finally { MDCContext.clear() }`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [solr] madrob commented on pull request #583: SOLR-14686: fix MDC log clear in SolrCore.close

Posted by GitBox <gi...@apache.org>.
madrob commented on pull request #583:
URL: https://github.com/apache/solr/pull/583#issuecomment-1027069314


   Do we have a test that demonstrated this? Might not fail, but at least something I can look at the log output from?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [solr] dsmiley commented on pull request #583: SOLR-14686: fix MDC log clear in SolrCore.close

Posted by GitBox <gi...@apache.org>.
dsmiley commented on pull request #583:
URL: https://github.com/apache/solr/pull/583#issuecomment-1027186107


   Yeah I was thinking try-finally as well but wasn't sure I wanted to make this change over this.  I'll do it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [solr] dsmiley merged pull request #583: SOLR-14686: fix MDC log clear in SolrCore.close

Posted by GitBox <gi...@apache.org>.
dsmiley merged pull request #583:
URL: https://github.com/apache/solr/pull/583


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [solr] dsmiley commented on a change in pull request #583: SOLR-14686: fix MDC log clear in SolrCore.close

Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #583:
URL: https://github.com/apache/solr/pull/583#discussion_r797276346



##########
File path: solr/core/src/java/org/apache/solr/core/SolrCore.java
##########
@@ -1573,13 +1573,20 @@ public void open() {
    */
   @Override
   public void close() {
-    int count = refCount.decrementAndGet();
-    if (count > 0) return; // close is called often, and only actually closes if nothing is using it.

Review comment:
       The javadocs on this method are excellent though, so it seemed redundant




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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