Summary: | Missing JavaCore in JDT/Core project index | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> | ||||
Component: | Core | Assignee: | Kent Johnson <kent_johnson> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | Darin_Swanson | ||||
Version: | 2.1 | ||||||
Target Milestone: | 2.1 RC1 | ||||||
Hardware: | PC | ||||||
OS: | Windows 2000 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Philipe Mulet
2003-02-19 05:38:11 EST
No trace in the log, similar operation on a different machine did work ok. Wondering if we have a concurrency issue somewhere ? Also my workspace was setup as a full source workspace. Worked around by manually discarding index files, after recreation, JavaCore was back... 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... 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. 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. Change the constant signature again to reset invalid indexes files. 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). Closing as fixed by last additions to index support. 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 Created attachment 3591 [details]
Incomplete index file for jdt/core
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. 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... 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. 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 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 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; } } I could not reproduce anymore with your steps using latest code. Verified that without the fix, I can reproduce it and with the fix the problem is gone. Closing as fixed then. *** Bug 32313 has been marked as a duplicate of this bug. *** Verified. |