Bug 14490

Summary: Possible concurrency hole when saving index before query
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Jerome Lanneluc CLA 2002-04-24 08:08:36 EDT
Build 20020423

There is a possible concurrency hole (that could explain some of the indexer 
crashes) when saving the index before querying it.

The problem is that the following pattern is used:
monitor.enterWrite();
index.save();
monitor.exitWrite();
monitor.enterRead();
index.queryInDocumentNames(...);
monitor.exitRead();

Between exitWrite() and enterRead(), a writer is able to write to the index.
Comment 1 Jerome Lanneluc CLA 2002-04-24 08:11:29 EDT
Fixed by adding ReadWriteMonitor.exitWriteEnterRead().
Also removed the save() in all the index query methods. This is done by the 
client.