Bug 32217 - Missing JavaCore in JDT/Core project index
Summary: Missing JavaCore in JDT/Core project index
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 32313 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-02-19 05:38 EST by Philipe Mulet CLA
Modified: 2003-03-11 09:36 EST (History)
1 user (show)

See Also:


Attachments
Incomplete index file for jdt/core (32.16 KB, application/octet-stream)
2003-02-20 06:49 EST, Philipe Mulet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2003-02-19 05:38:11 EST
Build 20030218

After restarting dev workspace in this build, perform 'OpenType' will trigger 
all workspace reindexing (since index signatures did change).

Type in dialog 'JavaCore' found nothing !?!

Tried to go to the Java search page, search for declarations of type 'JavaCore' 
in project org.eclipse.jdt.core did not find anything either.

Seems like JavaCore got omitted from the index file.
Comment 1 Philipe Mulet CLA 2003-02-19 05:39:57 EST
No trace in the log, similar operation on a different machine did work ok.
Wondering if we have a concurrency issue somewhere ?
Comment 2 Philipe Mulet CLA 2003-02-19 05:40:37 EST
Also my workspace was setup as a full source workspace.
Comment 3 Philipe Mulet CLA 2003-02-19 07:00:08 EST
Worked around by manually discarding index files, after recreation, JavaCore 
was back...
Comment 4 Philipe Mulet CLA 2003-02-19 08:50:56 EST
Jerome just mentionned he saw this issue as well. Could it be resolved with 
your latest changes, Kent ?

Tagging as RC1. Index signature changes seem to cause trouble...
Comment 5 Kent Johnson CLA 2003-02-19 13:29:50 EST
I think this is a result of the bogus code that was in Index.initialize() 
before I changed bug 32107.

With that code as soon as the format changed was detected, the index on disk 
was deleted & recreated as an empty index. Any file updates would be added to 
the empty index.

Olivier is going to try to reproduce from scratch. He'll let us know.
Comment 6 Olivier Thomann CLA 2003-02-19 15:13:31 EST
This seems to be related to a incomplete change. You were in the middle of two
changes.
1) Change the constant signature and search.
2) Apply your fix in the workspace.

Did you actually run your workspace with the constant change in it only and not
the fix?

We reproduced it with the constant change, but not your fix in. If both are in,
it is not possible to reproduce it.

Would close as WORKSFORME.
Comment 7 Olivier Thomann CLA 2003-02-19 15:17:52 EST
Change the constant signature again to reset invalid indexes files.
Comment 8 Philipe Mulet CLA 2003-02-20 05:21:10 EST
The optimal change from Kent wasn't in build 20030218, so I was quite certainly 
in that intermediate state you described.

Will try to see if I can reproduce with a patch (signature change+Kent's fix).
Comment 9 Philipe Mulet CLA 2003-02-20 05:27:38 EST
Closing as fixed by last additions to index support.
Comment 10 Philipe Mulet CLA 2003-02-20 06:48:45 EST
Reopening, after patching with our latest, problem was still there (index file 
for JDT/Core is only 33KB big). This time I was missing ICompletionRequestor.

Attaching offending index file: 1689418278.index
Comment 11 Philipe Mulet CLA 2003-02-20 06:49:39 EST
Created attachment 3591 [details]
Incomplete index file for jdt/core
Comment 12 Philipe Mulet CLA 2003-02-20 06:52:21 EST
What I did is:

- started from a workspace believed to be consistent (~500KB index for 
jdt/core).
- exited and patched with our latest (which did have another signature 
increment)
- restarted workspace
- touched JavaCore, and synchronize with repo (no actual change checked out 
except for buildnotes).
- then open type (reindexed the world)
- JavaCore was there, but ICompletionRequestor wasn't.
Comment 13 Philipe Mulet CLA 2003-02-20 07:27:47 EST
With the previous steps I reproduced it again, ended up with 1689418278.index 
of size 33KB instead of 500K.

I have a full source workspace, could it be an overflowing situation (too many 
items queued for indexing) ? 

Will try to get a full trace...
Comment 14 Philipe Mulet CLA 2003-02-20 08:07:31 EST
Added 3 traces: 
- one when failing to reuse existing index (IOException in getIndex)
- one in rebuildIndex
- one in recrateIndex

See portions of the generated trace below:

AFTER RESTART, TOUCH JavaCore. Observe that the index could not be reused, 
however it never explicitely recreated it (start from an empty one I presume).
From thereon our index is busted.

(Thread[main,5,main]) Reset
(Thread[main,5,main]) -> index name for \org.eclipse.jdt.core is 
1689418278.index
(Thread[main,5,main]) Saved indexes are now : ...
(Thread[main,5,main]) REQUESTING job - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
(Thread[Java indexing,4,main]) 1 awaiting jobs
(Thread[Java indexing,4,main]) STARTING to execute - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
(Thread[Java indexing,4,main]) -> cannot reuse existing index: 
D:\eclipse\workspaces\dev2.0
\plugins\.metadata\.plugins\org.eclipse.jdt.core\1689418278.index path: 
\org.eclipse.jdt.core
(Thread[Java indexing,4,main]) DONE executing - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
(Thread[Java indexing,4,main]) -> merging index D:\eclipse\workspaces\dev2.0
\plugins\.metadata\.plugins\org.eclipse.jdt.core\1689418278.index
(Thread[Java indexing,4,main]) Saved indexes are now : ...

CHECKED OUT A COUPLE CHANGES....

(Thread[ModalContext,5,main]) REQUESTING job - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Hie
rarchyBuilder.java
(Thread[ModalContext,5,main]) REQUESTING job - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Hie
rarchyResolver.java
(Thread[ModalContext,5,main]) REQUESTING job - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Ind
exBasedHierarchyBuilder.java
(Thread[ModalContext,5,main]) REQUESTING job - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Reg
ionBasedHierarchyBuilder.java
(Thread[ModalContext,5,main]) REQUESTING job - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Typ
eHierarchy.java
(Thread[Java indexing,4,main]) 5 awaiting jobs
(Thread[Java indexing,4,main]) STARTING to execute - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Hie
rarchyBuilder.java
(Thread[Java indexing,4,main]) DONE executing - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Hie
rarchyBuilder.java
(Thread[Java indexing,4,main]) 4 awaiting jobs
(Thread[Java indexing,4,main]) STARTING to execute - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Hie
rarchyResolver.java
(Thread[Java indexing,4,main]) DONE executing - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Hie
rarchyResolver.java
(Thread[Java indexing,4,main]) 3 awaiting jobs
(Thread[Java indexing,4,main]) STARTING to execute - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Ind
exBasedHierarchyBuilder.java
(Thread[Java indexing,4,main]) DONE executing - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Ind
exBasedHierarchyBuilder.java
(Thread[Java indexing,4,main]) 2 awaiting jobs
(Thread[Java indexing,4,main]) STARTING to execute - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Reg
ionBasedHierarchyBuilder.java
(Thread[Java indexing,4,main]) DONE executing - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Reg
ionBasedHierarchyBuilder.java
(Thread[Java indexing,4,main]) 1 awaiting jobs
(Thread[Java indexing,4,main]) STARTING to execute - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Typ
eHierarchy.java
(Thread[Java indexing,4,main]) DONE executing - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/Typ
eHierarchy.java
(Thread[Java indexing,4,main]) -> merging index D:\eclipse\workspaces\dev2.0
\plugins\.metadata\.plugins\org.eclipse.jdt.core\1689418278.index
(Thread[Java indexing,4,main]) Saved indexes are now : ... 

PRESS CTRL-SHIFT-T (OpenType)and wait. All indexes are being rebuilt, like one 
for project A below. JDT/Core index isn't being rebuilt since it already got an 
empty new one at this stage.

(Thread[ModalContext,5,main]) STARTING concurrent job - searching 
TypeDeclarationPattern: pkg<>, enclosing<>, type<>, pattern match, case 
insensitive
(Thread[ModalContext,5,main]) -> index name for \A is 1443656097.index
(Thread[ModalContext,5,main]) -> cannot reuse existing index: 
D:\eclipse\workspaces\dev2.0
\plugins\.metadata\.plugins\org.eclipse.jdt.core\1443656097.index path: \A
(Thread[ModalContext,5,main]) -> request to rebuild index: 
D:\eclipse\workspaces\dev2.0
\plugins\.metadata\.plugins\org.eclipse.jdt.core\1443656097.index path: \A
...

Can provide 4MB full trace if necessary.
Comment 15 Philipe Mulet CLA 2003-02-20 08:18:31 EST
A one project workspace should suffice to reproduce. The problem occurs as soon 
as both of these events occur at same time with an old workspace:
- index signature got changed
- one performs local source edits before doing the first search query
Comment 16 Philipe Mulet CLA 2003-02-20 08:35:18 EST
With a change to #getIndex (see below), I obtain a better trace when touching 
JavaCore.java

(Thread[main,5,main]) REQUESTING job - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
(Thread[Java indexing,4,main]) 1 awaiting jobs
(Thread[Java indexing,4,main]) STARTING to execute - 
indexing /org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
(Thread[Java indexing,4,main]) -> cannot reuse existing index: 
D:\eclipse\workspaces\dev2.0
\plugins\.metadata\.plugins\org.eclipse.jdt.core\1689418278.index path: 
\org.eclipse.jdt.core
(Thread[Java indexing,4,main]) -> request to rebuild index: 
D:\eclipse\workspaces\dev2.0
\plugins\.metadata\.plugins\org.eclipse.jdt.core\1689418278.index path: 
\org.eclipse.jdt.core


Comment 17 Philipe Mulet CLA 2003-02-20 08:38:23 EST
See ## for change in getIndex(...). 

// index isn't cached, consider reusing an existing index file
if (reuseExistingFile) {
	File indexFile = new File(indexName);
	if (indexFile.exists()) { 
		try {
			index = new Index(...); //$NON-NLS-1$
			indexes.put(path, index);
			monitors.put(index, new ReadWriteMonitor());
			return index;
		} catch (IOException e) {
			// failed to read 
##			rebuildIndex(indexName, path);
##			return null;
		}
	}
	if (currentIndexState == SAVED_STATE) { // rebuild index ...
		rebuildIndex(indexName, path);
		return null;
	}
} 
Comment 18 Olivier Thomann CLA 2003-02-20 09:01:36 EST
I could not reproduce anymore with your steps using latest code.
Comment 19 Olivier Thomann CLA 2003-02-20 09:34:34 EST
Verified that without the fix, I can reproduce it and with the fix the problem
is gone.
Comment 20 Philipe Mulet CLA 2003-02-20 10:36:08 EST
Closing as fixed then. 
Comment 21 Dani Megert CLA 2003-02-20 12:21:13 EST
*** Bug 32313 has been marked as a duplicate of this bug. ***
Comment 22 David Audel CLA 2003-03-11 09:36:12 EST
Verified.