Bug 165170 - [67cat] Opened files full of errors after restart
[67cat] Opened files full of errors after restart
Status: VERIFIED FIXED
Product: editor
Classification: Unclassified
Component: Parsing & Indexing
6.x
PC Linux
: P2 (vote)
: 6.x
Assigned To: Vitezslav Stejskal
issues@editor
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-14 13:43 UTC by Michel Graciano
Modified: 2009-05-25 15:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2009-05-14 13:43:30 UTC
[ BUILD # : 200905140201 ]
[ JDK VERSION : 1.6.* ]

I have some opened files from an opened project and when I start IDE,
the scan doesn't starts and the files are not parsed so, several
errors are shown.
Comment 1 Michel Graciano 2009-05-14 13:44:17 UTC
Until build 200905120201 everything works fine.
Comment 2 Michel Graciano 2009-05-14 13:47:25 UTC
Here, I have freeform project and the workarounds I use are close and reopen the project or open Window > Tasks.
Comment 3 Michel Graciano 2009-05-14 13:57:18 UTC
Another strange behaviour... :(
If I add -J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE at netbeans.conf the scan is always
executed... if I remove it, the scan doesn't run again at startup.
Comment 4 Michel Graciano 2009-05-14 14:07:07 UTC
Just to clarify the last post, not always, but at most of times the scan is executed when I change the parameter... no
idea why... probably just an coincidence.
Comment 5 Vitezslav Stejskal 2009-05-14 15:00:51 UTC
I'm quite positive that the scan always starts. What you see is most likely a problem that some tasks run even before
the initial scan. Typically these tasks are launched from ProjectOpenedHook and since the initial scan waits for all
projects to get opened any task launched from ProjectOpenHook (even if launched through
ParserManager.parseWhenScanFinished()) will run before the initial scan. I'll fix that.
Comment 6 Michel Graciano 2009-05-14 18:06:50 UTC
Vita, I don't agree with new subject. Another errors are that Go to Type doesn't work too as well if I open any file
from Projects view. Anything that need indexes doesn't work until scan is started at least once.

Regards
Comment 7 Vitezslav Stejskal 2009-05-15 09:50:19 UTC
"Anything that need indexes doesn't work until scan is started at least once" - Correct. I think I know why that is so.
I filed issue #165245 to cover this problem.
Comment 8 Vitezslav Stejskal 2009-05-15 22:07:53 UTC
This should now behave better - http://hg.netbeans.org/jet-main/rev/6a59b3dc1388. There are still many problems with
badges, see issue #121950. The roots of these problems lie back in Nb6.0 and there is no simple solution for them. We
will try to do a bit of an overhaul of this part in 6.8, but for 6.7 this is simply as good as it is. I'm sorry.
Comment 9 Quality Engineering 2009-05-17 18:32:45 UTC
Integrated into 'main-golden', will be available in build *200905171401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6a59b3dc1388
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #165170: block TaskProcessor after the IDE start until the projects are open
Comment 10 Vitezslav Stejskal 2009-05-18 10:57:05 UTC
Just for the record, this is a related changeset - http://hg.netbeans.org/jet-main/rev/0c0c5e853b3d
Comment 11 Michel Graciano 2009-05-18 14:24:33 UTC
Now, it is worst than before. Now, when I open the IDE, files are not parsed, so, no code folding available as well Go
to Type doesn't work too. And, after several seconds (almost one minute), files are parsed and everything in file is
broken (no files can be compiled by editor). And, even I start Tasks for example, nothing change. So, I just can't use
this build.

Product Version: NetBeans IDE Dev (Build 200905180201)
Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16
System: Linux version 2.6.27-14-generic running on i386; ISO-8859-1; en_US (nb)
Userdir: /home/hmichel/.netbeans/dev
Comment 12 Michel Graciano 2009-05-18 15:16:05 UTC
O increased the priority since now there is no workaround and the latest build is unusable. I switched to 200905151401.
Comment 13 Vitezslav Stejskal 2009-05-18 16:41:20 UTC
Ok, I reverted 6a59b3dc1388. http://hg.netbeans.org/jet-main/rev/9bfb851c4619
Comment 14 Vitezslav Stejskal 2009-05-19 08:38:41 UTC
"when I start IDE, the scan doesn't starts" - I think I found the way how to replicate this (at least sometimes). If
there are only a few projects and they open really fast. Sometimes they are opened even before the indexing is
initialized and so the initial set of events about new classpath registered from the projects don't arrive.
Comment 15 Michel Graciano 2009-05-19 13:58:09 UTC
I have 2 hudson repositories added to Hudson support. I can see that this job always run, and when the 'Scanning
projects' run, is always after (at least it is what seen to me) hudson stops.
BTW, I have just one huge project opened at the time (I can reproduce it with more than one too) and some source files
too (3 or 4). I will try to test a little bit more and get more details to you. If you need any log or someting else,
just let me know.
Comment 16 Michel Graciano 2009-05-19 14:32:47 UTC
BTW, I can't reproduce it anymore for build 200905190201. If I try with build 200905180201, nothing works and for build
200905151401, sometimes I need to open Tasks to force rescan. I will continue to test it the latest build and confirm
that the problem doesn't exists more for me.
For all tests, I've used the same userdir.

Product Version: NetBeans IDE Dev (Build 200905190201)
Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16
System: Linux version 2.6.27-14-generic running on i386; ISO-8859-1; en_US (nb)
Comment 17 Vitezslav Stejskal 2009-05-19 15:05:55 UTC
Ok, here is another attempt to fix this - http://hg.netbeans.org/jet-main/rev/fe24cebec2fe.

The indexing is now initialized as soon as the parsing.api module is loaded, which ought to be before the IDE starts
opening projects. That way we should not miss any events from GlobalPathRegistry and correctly pick up all classpaths
registered from the projects.

The initial scan is now also started when editors are opened, which apparently happens in no relation to opening
projects. I think this was the main reason for editors showing errors after starting the IDE. The files were open, but
their projects were not and so there was no classpath, etc available for the files. Unfortunately the indexing blocks
other editor background tasks like semantic highlighting, code folds, etc, which are therefore unavailable until the
initial scan is done. I'm not sure if I'll be able to do something about it. So far it looks like that we can either let
the background tasks run and have a good chance of having the files opened in the editor marked with errors or we block
the background tasks and have no code folds, semantic coloring, etc.

Please try the fix and let me know.
Comment 18 Michel Graciano 2009-05-19 15:50:27 UTC
Ok, after several tests, I can reproduce the problem. Many times I restart the IDE, it opens without run the scan, so
the opened source files has compilation errors and another problems I talked before.
Comment 19 Michel Graciano 2009-05-19 17:53:04 UTC
I will test your fix as soon as the build is available.
Comment 20 Vitezslav Stejskal 2009-05-20 11:58:08 UTC
Thanks and sorry for the delay, the fix caused some commit-validation tests to fail (ie. because of several unexpected
classes loaded on too early during the startup). Anyway, I fixed that and so the changes should propagate to today's
build. I'll keep an eye on it.
Comment 21 Quality Engineering 2009-05-21 08:18:14 UTC
Integrated into 'main-golden', will be available in build *200905210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/fe24cebec2fe
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #165170: initializing RepositoryUpdater as soon as possible; forcing initial scan from editor registry events
Comment 22 Vitezslav Stejskal 2009-05-22 09:40:13 UTC
Ok, this should be now fixed.
Comment 23 Michel Graciano 2009-05-25 15:07:18 UTC
Looks fixed to me too. Testing for feel days and the problem doesn't happen again. Thanks.
v. 200905250201


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo