This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 151267

Summary: Lock in waitScanFinished ()
Product: java Reporter: Lukas Jungmann <jungi>
Component: SourceAssignee: Pavel Flaska <pflaska>
Status: VERIFIED FIXED    
Severity: blocker CC: jbecicka, jrechtacek, jtulach, mmirilovic, sustaining, tzezula
Priority: P2 Keywords: RANDOM
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: original threaddump
Obrazek I
Obrazek I
Obrazek II
Suggested fix - need testing (contains also logging)

Description Lukas Jungmann 2008-10-24 13:08:09 UTC
Description:
   From time to time IDE thinks that there's classpath scan running in the background but there's no user visible
feedback regarding this in the progress bar in the right bottom corner of the IDE

User impact:
   No java refactoring features can be used

Workaround:
   none - only restart of the IDE

reproducibility:
   Almost 100% reproducible in tests[1] on hudson4qe, randomly appearing during manual work in the IDE. I managed to
reproduce this on win vista + jdk6u10fcs, ubuntu + jdk6u10fcs manually and on various configs in tests including winXP,
XP-64b, ubuntu, solaris and JDK 1.5 u15, u16, u17 and JDK6u10.


evaluation from Tomas Z.:

"It seems that RU is waiting in waitu:

public synchronized void waitScanFinished () throws InterruptedException {
        while (isScanInProgress()) {
            this.wait(1000);
        }
    } 
"

Heap dumps from JDK5_u17 and JDK6_u10 were scp'ed to Pavel F. already.

[1]: ant -f $HG_ROOT/websvc.restkit/build.xml clean test-qa-functional -Dtest.config=stable
-Dtest-qa-functional-sys-prop.glassfish.home=/home/lukas/_rc1/glassfish-v2ur2
Comment 1 Lukas Jungmann 2008-10-24 13:14:18 UTC
Created attachment 72589 [details]
original threaddump
Comment 2 Pavel Flaska 2008-10-24 13:39:25 UTC
My first observations (based on dump from Lukas):

return 
notInitialized || this.noSubmited > 0 || !GlobalSourcePath.getDefault().isFinished();

notInitialized is false;
this.noSubmited is 1;
firerTask.finished is true

Cc'ing Tomas, it does not seem to be related to RP as Yarda expected.



Comment 3 Pavel Flaska 2008-10-24 13:43:15 UTC
Created attachment 72596 [details]
Obrazek I
Comment 4 Pavel Flaska 2008-10-24 13:43:18 UTC
Created attachment 72597 [details]
Obrazek I
Comment 5 Pavel Flaska 2008-10-24 13:43:59 UTC
Created attachment 72598 [details]
Obrazek II
Comment 6 Tomas Zezula 2008-10-24 13:53:09 UTC
It's strange,  the noSubmitted is decreased in finally block of worker. Anyway we can add debug messages to find out why it's not decreased.

Comment 7 Lukas Jungmann 2008-11-07 11:54:56 UTC
btw: I think I've found at least somehow reliable way how to reproduce this in 6.5 RC2-FCS build on linux JDK6u10 or at
least it happend to me during last week quite often after following steps:

-start IDE (Java configuration, all servers installed)
-open websvc.kit and websvc.restkit modules
-open arbitrary test from qa-functional packages

repeat:
  -work on it (ie. adding new tests, methods etc.)
  -run Run File on it
  - (let the test finish) || (stop the test by "Stop" button in IDE's output tab) || (somehow close IDE opened by a test)
end repeat

at some point (usually after 2 or more hours of work) code completion starts to show only "Scanning in progress",
refactoring, find usages etc stops working.

-I'm adding RANDOM kw anyway since I still don't have any exact steps
-in case you want to try it yourself, here's info about tests:
http://wiki.netbeans.org/WSTests#section-WSTests-FunctionalTests
Comment 8 Jan Lahoda 2008-11-18 16:42:44 UTC
*** Issue 153128 has been marked as a duplicate of this issue. ***
Comment 9 Pavel Flaska 2008-12-04 12:56:14 UTC
*** Issue 154355 has been marked as a duplicate of this issue. ***
Comment 10 Pavel Flaska 2008-12-11 10:23:39 UTC
Created attachment 74843 [details]
Suggested fix - need testing (contains also logging)
Comment 11 Lukas Jungmann 2008-12-12 10:05:50 UTC
suggested fix seems to be OK - at least I haven't been able to reproduce this again. Would it be possible to keep
logging there (say at FINEST level) for a few days in case this happen in tests?

Thanks.
Comment 12 Pavel Flaska 2008-12-12 11:05:27 UTC
http://hg.netbeans.org/main?cmd=changeset;node=8e9624033606

Patch applied. -- Logging is available at FINEST level. Thanks Honza and Tomas. Once verified, 
Comment 13 Quality Engineering 2008-12-13 17:02:10 UTC
Integrated into 'main-golden', will be available in build *200812131401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8e9624033606
User: Pavel Flaska <pflaska@netbeans.org>
Log: #151267: Scanning does not finish
Comment 14 Lukas Jungmann 2008-12-21 16:39:19 UTC
me neither tests we're able to reproduce this during last week => v.
Comment 15 pgebauer 2009-01-05 14:17:15 UTC
The fix has been ported into the release65_fixes repository.

http://hg.netbeans.org/release65_fixes/rev/411ce939197e