Bug 14490 - Possible concurrency hole when saving index before query
Summary: Possible concurrency hole when saving index before query
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-24 08:08 EDT by Jerome Lanneluc CLA
Modified: 2002-04-24 08:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.