You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Kay Kay (JIRA)" <ji...@apache.org> on 2008/12/18 22:35:44 UTC

[jira] Created: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

SolrCore.close() : Warn in the logger when the internal reference count is > 0
------------------------------------------------------------------------------

                 Key: SOLR-930
                 URL: https://issues.apache.org/jira/browse/SOLR-930
             Project: Solr
          Issue Type: Improvement
         Environment: Java 6, Tomcat 6 
            Reporter: Kay Kay
            Priority: Minor
             Fix For: 1.3.1


SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658138#action_12658138 ] 

Yonik Seeley commented on SOLR-930:
-----------------------------------

The count being greater than zero is not an error condition - close() is called on every request.
This patch should be reverted.

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan McKinley reassigned SOLR-930:
----------------------------------

    Assignee: Ryan McKinley

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.3.1
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan McKinley reopened SOLR-930:
--------------------------------


> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kay Kay reopened SOLR-930:
--------------------------


Reopening the issue - since close() is important to keep track of if the SolrCore is active ( if we were to re-register the core ,etc.) 

If count > 0 - close() returns silently as of now. 

If count < 0 , close() logs an error ( previously - it used to throwing an exception at least , to signify that we are into uncharted territory ). 

With the current behavior - it is impossible to actually know if close() indeed completed successfully with counter set to 0, and it will be hard to track memory references / reachability of object during memory leaks with the current behavior. 

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658105#action_12658105 ] 

Kay Kay commented on SOLR-930:
------------------------------

I believe the fact that refcount > 0 while closing is still a warning. If this were frequent enough - then probably some other resource manager, after incrementing the count is not decrementing the same after the use . We need to address that separately as opposed to commenting this one out. 

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658153#action_12658153 ] 

Kay Kay commented on SOLR-930:
------------------------------

Thanks Hoss . That clarifies. 

Added @see to the javadoc to clarify more about it. Also - modified the javadoc about throwing exceptions if refCount < 0  (the code does not do it anymore ). 

The revised patch should be javadoc changes relevant to the part. 

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch, SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658148#action_12658148 ] 

Hoss Man commented on SOLR-930:
-------------------------------

1) i think you are miss-understanding the point of close() ... it's called by every person who uses the core once they are done with it to indicate they are done with it.  the resources are only truely freed once the count returns to 1 ... note the javadocs of hte method.

2) if you want to know if all the resources have been freed (ie: everyone using the core has closed it) use "isClosed()"


perhaps the confusion here is just the legacy name (close() was named back when SolrCore was a singleton i believe).



> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan McKinley resolved SOLR-930.
--------------------------------

    Resolution: Invalid

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man resolved SOLR-930.
---------------------------

    Resolution: Fixed

Kay: @see tags can't contain {@link} tags (at least not in Javadoc 1.5)

I took some of the text from your patch and reworked it into some new javadocs that are a bit more explicit about what exactly is going on under the hood...

Committed revision 736518.


> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch, SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658107#action_12658107 ] 

Ryan McKinley commented on SOLR-930:
------------------------------------

for now, i will just change the log level to "debug"

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kay Kay updated SOLR-930:
-------------------------

    Attachment: SOLR-930.patch

Updating javadoc about not throwing exceptions . 

Added @see isClosed() for cross-reference. 

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch, SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan McKinley resolved SOLR-930.
--------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.3.1)
                   1.4

added in trunk.
thanks Kay

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658020#action_12658020 ] 

Shalin Shekhar Mangar commented on SOLR-930:
--------------------------------------------

Ryan, after this commit, I see the following message on almost every request to Solr. Just use the example jetty and request any JSP (stats/info) and you will find the warning in the log. Perhaps this logging is not needed?

{code}WARNING: Attempted close on org.apache.solr.core.SolrCore@b86944 did not succeed because the new reference count 1 is > 0{code}

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kay Kay updated SOLR-930:
-------------------------

    Attachment: SOLR-930.patch

--- src/java/org/apache/solr/core/SolrCore.java	(revision 727831)

   public void close() {
     int count = refCount.decrementAndGet();
-    if (count > 0) return;
+    if (count > 0) {
+      log.warn("Attempted close on " + this + " did not succeed because the new reference count " + count + " is > 0. ");
+      return;
+    }


> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Priority: Minor
>             Fix For: 1.3.1
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kay Kay closed SOLR-930.
------------------------


| Kay: @see tags can't contain {@link} tags (at least not in Javadoc 1.5) 

Oops - I was using java 6 (javadoc compiler). Thanks for the clarification in the docs. 

> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch, SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-930) SolrCore.close() : Warn in the logger when the internal reference count is > 0

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658140#action_12658140 ] 

Kay Kay commented on SOLR-930:
------------------------------

If it were not an error condition - something has to be abnormal since we are not releasing resources / calling closeHooks - upon close and return prematurely right at the beginning of the function. 

So - it indicates a possible resource leak that needs to be looked into, (possibly elsewhere ). 

I am not for reverting / changing the logging level . 



> SolrCore.close() : Warn in the logger when the internal reference count is > 0
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-930
>                 URL: https://issues.apache.org/jira/browse/SOLR-930
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6 
>            Reporter: Kay Kay
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-930.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> SolrCore.close() -> Add a warning statement when the internal reference count is > 0. ( as opposed to 0, as expected ) - 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.