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

Milos Kleint commented on MINDEXER-63:
--------------------------------------

I'm not so sure that our synchronisation is the fault here. We used to have 
synchronisation even before 5.0.0 upgrade, all access is a write mutex AFAIK, 
used to have read mutex for searches for a while I believe but with the 
previous versions it didn't work out, so we changed it all to write access. so 
always just one man (thread) accessing the whole thing (currently per context, 
used to be global)

there could some unrelated access to the files from the IDE, like native 
listeners getting hold of the file changes and the IDE processes them. AFAIK 
there's no listener watching over the cache folders with maven indexes though. 
According to the report at [1] there only 2 incidents reported, both probably 
coming from the same guy on the same same day. 

so let's call it a user setup error for now. but I believe my initial 
evaluation still stands, if something unexpected happens, the replace() method 
doesn't recover well.


[1] http://statistics.netbeans.org/exceptions/detail.do?id=193177
                
> NullPointerException at 
> org.apache.maven.index.context.DefaultIndexingContext.acquireIndexSearcher
> --------------------------------------------------------------------------------------------------
>
>                 Key: MINDEXER-63
>                 URL: https://jira.codehaus.org/browse/MINDEXER-63
>             Project: Maven Indexer
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>         Environment: netbeans 7.3 dev builds.
>            Reporter: Milos Kleint
>            Priority: Critical
>
> see issue http://netbeans.org/bugzilla/show_bug.cgi?id=219645
> for some reason (unknown to me yet) the index files cannot be deleted. The 
> codebase then gets into bad state.
> possibly wrong code in DefaultIndexingContext:
> {code:java}
> public synchronized void replace( Directory directory )
>      throws IOException
>   {
>         final Date ts = IndexUtils.getTimestamp( directory );
>         closeReaders();
>         deleteIndexFiles( false );
>         IndexUtils.copyDirectory( directory, indexDirectory );
>         openAndWarmup();
>         // reclaim the index as mine
>         storeDescriptor();
>         updateTimestamp( true, ts );
>         optimize();
>  }
> {code}
> when deleteIndexFiles(0 fails, openAndWarmup() is not called. also 
> closeReaders() ignores indexWriter..

--
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


Reply via email to