You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tamás Cservenák (JIRA)" <ji...@codehaus.org> on 2012/07/30 19:57:21 UTC

[jira] (MINDEXER-52) reentrant locking in DefaultIndexingContent flawed

    [ https://jira.codehaus.org/browse/MINDEXER-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=304992#comment-304992 ] 

Tamás Cservenák commented on MINDEXER-52:
-----------------------------------------

Jesse got it: it intention was to warm and preload indexes, and true, this made sense in Nexus-like applications (that's from where Maven Indexer comes actually).

I'd say just remove from call chain, but expose this method (as warmpUp() or whatever) on the Context itself and let the integrating software decide should it use it or use some other stuff or not use it at all.
                
> reentrant locking in DefaultIndexingContent flawed
> --------------------------------------------------
>
>                 Key: MINDEXER-52
>                 URL: https://jira.codehaus.org/browse/MINDEXER-52
>             Project: Maven Indexer
>          Issue Type: Bug
>    Affects Versions: 4.1.2
>            Reporter: Milos Kleint
>            Priority: Critical
>
> DefaultIndexingContent.java contains the following pattern:
> {code:java}
>     public IndexReader getIndexReader()
>         throws IOException
>     {
>         lock();
>         try
>         {
>             return indexReader;
>         }
>         finally
>         {
>             unlock();
>         }
>     }
> {code}
> together with installBottleWarmer() method that spawns a concurrent thread that performs "warmup" operations, it makes it impossible to access the indexReader instance safely. A correct approach would be to wrap the entire operation with the indexreader in the mutex lock, not the the accessor method.
> please see http://netbeans.org/bugzilla/show_bug.cgi?id=204706  and http://statistics.netbeans.org/exceptions/detail.do?id=180712 for examples when this approach is failing. it's fairly rare but  keeps on reoccuring, all access (searching, indexing) from netbeans is protected by a mutex and happens exclusively. I'm assuming that the installBottleWarmer() thread is the one iterfering with our access occasionally.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira