Bug 5907 - Indexer errors when disk full
Summary: Indexer errors when disk full
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 5837 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-11-14 11:22 EST by John Arthorne CLA
Modified: 2002-01-11 09:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2001-11-14 11:22:16 EST
Build 20011108

When the hard-disk is full, the indexer can choke while trying to save.  This is 
a borderline case, but since indexes write alot to disk, it's not unheard of.  
Here's the stack trace:

java.lang.ArrayIndexOutOfBoundsException: 883
	at 
org.eclipse.jdt.internal.core.index.impl.MergeFactory.mergeFiles(MergeFactory.ja
va:136)
	at 
org.eclipse.jdt.internal.core.index.impl.MergeFactory.merge(MergeFactory.java:77
)
	at org.eclipse.jdt.internal.core.index.impl.Index.merge(Index.java:231)
	at org.eclipse.jdt.internal.core.index.impl.Index.save(Index.java:340)
	at 
org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndexes(IndexMana
ger.java:335)
	at 
org.eclipse.jdt.internal.core.search.indexing.IndexManager.notifyIdle(IndexManag
er.java:267)
	at 
org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:2
54)
	at java.lang.Thread.run(Thread.java:498)
Comment 1 John Arthorne CLA 2001-11-14 12:14:25 EST
This failure mode is bad, because if I shutdown the workbench, clear up enough 
space on my hard-disk, and then restart, I get another error:

java.lang.ArrayIndexOutOfBoundsException: 1551
	at 
org.eclipse.jdt.internal.core.index.impl.MergeFactory.mergeFiles(MergeFactory.ja
va:136)
	at 
org.eclipse.jdt.internal.core.index.impl.MergeFactory.merge(MergeFactory.java:77
)
	at org.eclipse.jdt.internal.core.index.impl.Index.merge(Index.java:231)
	at org.eclipse.jdt.internal.core.index.impl.Index.save(Index.java:340)
	at 
org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndexes(IndexMana
ger.java:335)
	at 
org.eclipse.jdt.internal.core.search.indexing.IndexManager.notifyIdle(IndexManag
er.java:267)
	at 
org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:2
54)
	at java.lang.Thread.run(Thread.java:498)
Comment 2 Philipe Mulet CLA 2001-11-15 06:53:54 EST
Would this be related to the other merge issue we have been seeing ?
Protection should probably be added, no problem if the index is left 
inconsistent beyond that point, since there is no more disk space anyway.
Comment 3 Jerome Lanneluc CLA 2001-11-21 04:41:16 EST
By any chance, do you still have the workspace that when restarted caused the 
second stack trace?
Comment 4 John Arthorne CLA 2001-11-21 09:50:23 EST
No I don't have the old workspace. Sorry, I should have kept it.  Here is a 
fairly easy way to reproduce the initial error:

1) Start with lots of disk space free
2) Create a java project with lots of classes
3) Delete the project, but don't delete content from disk
4) Fill the disk to within about 20K of being full
5) Recreate the java project on the existing content

Step 5 should kick in a large index operation that will fill the disk and cause 
the indexer errors.  I also found it best to work with the test workspace on a 
floppy drive, as this makes it easier to fill the disk without crashing other 
things (such as your dev environment).
Comment 5 Jerome Lanneluc CLA 2001-11-22 10:48:05 EST
Problem was that on the second merge (i.e. when part of the index was on disk), 
we got an IOException because of the full disk. However the file numbers in the 
InMemoryIndex had already been updated. So next time we tried to merge (i.e. 
when the index manager was idle), we failed with an 
ArrayIndexOutOfBoundsException as the 'merge' algorithm expected the file 
numbers of the InMemoryIndex to start with 1.
Comment 6 Philipe Mulet CLA 2001-11-29 11:18:07 EST
*** Bug 5837 has been marked as a duplicate of this bug. ***