Bug 205859 - deadlock on projects scanning
deadlock on projects scanning
Status: VERIFIED FIXED
Product: java
Classification: Unclassified
Component: Project
7.1
PC Linux
: P2 (vote)
: 7.1.1
Assigned To: Tomas Zezula
issues@java
71patch1-verified
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-02 15:17 UTC by anli
Modified: 2012-02-29 12:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
IDE session log file at deadlock (30.79 KB, text/plain)
2011-12-02 15:17 UTC, anli
Details
thread dump on deadlock (71.92 KB, text/plain)
2011-12-05 12:55 UTC, anli
Details
thread dump on deadlock, after fix, from golden (77.63 KB, text/plain)
2012-01-16 09:38 UTC, anli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description anli 2011-12-02 15:17:39 UTC
Created attachment 113766 [details]
IDE session log file at deadlock

Sorry, next deadlock here - described initially in this forum thread (with attachment):

http://forums.netbeans.org/viewtopic.php?t=45095

I'm also attaching log file after IDE start and before closing the IDE.
Starting with clean userdir doesn't help also.
Comment 1 anli 2011-12-02 15:52:15 UTC
It seems like the root of problem is a set of file opened in the editor: if to close all editor tabs before closing the IDE, chances to successfully open next IDE sessions are high: I have sequentially done it few times (5-6) just now.
Comment 2 Tomas Zezula 2011-12-05 10:27:05 UTC
From the screenshot it seems that the indexing thread is not yet active it waits until the projects are opened and then it starts to do the scanning. As there is the "Opening Projects" progress it does not seem to be parsing api.

Please can you attach the thread dump when the deadlock happened.
See http://wiki.netbeans.org/GenerateThreadDump how to generate the thread dump.
Thanks!
Comment 3 anli 2011-12-05 12:55:58 UTC
Created attachment 113818 [details]
thread dump on deadlock

As requested, a dump is attached.
Comment 4 Tomas Zezula 2011-12-05 13:01:58 UTC
Thanks!
Comment 5 Tomas Zezula 2011-12-05 13:06:35 UTC
caused by J2SEProject$ProjectOpenedHookImpl.projectOpened
Comment 6 Tomas Zezula 2011-12-05 15:25:50 UTC
Fixed jet-main c2e8e416dc43
Comment 7 anli 2011-12-05 15:37:56 UTC
Tomas, thanks!

Are there any chances the fix will be merged into final (or next rc) 7.1?
Comment 8 Tomas Zezula 2011-12-05 17:48:56 UTC
Depends on QA.
Only issues approved by QA are integrated into 7.1.
If it's not integrated into 7.1 it will become part of patch release 7.1.1.
If you think that it should be a part of 7.1 increase the priority otherwise no chances.
Adding the boss of QA to cc list. :-)
Comment 9 anli 2011-12-05 18:07:21 UTC
Tomas, 

As far as I have found a workaround (to close all editor tabs before closing IDE session), I'm not sure it would be honest from my side to increase the priority. OTOH the issue is too outstanding - to my taste, of course - to be ignored by QA. But it is my taste only :-)

And thanks again for quick fixing.
Comment 10 Tomas Zezula 2011-12-05 19:02:15 UTC
Increasing at least to P2.
Comment 11 Marian Mirilovic 2011-12-05 20:51:40 UTC
We have just one report so far .... 

Tomasi, 
do you think it's just recent regression ? If so we will fix it, if not I suggest to leave it open for 7.1 (we are close to FCS date) and fix it in 7.1.1(patch1).
Comment 12 Tomas Zezula 2011-12-06 09:17:31 UTC
The fixed code is there from time of NB 6.0. Maybe some thread ordering changed, but it's hard to say with lazy projects.
Comment 13 Quality Engineering 2011-12-06 12:13:41 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/c2e8e416dc43
User: Tomas Zezula <tzezula@netbeans.org>
Log: #205859:deadlock on projects scanning
Comment 14 Marian Mirilovic 2011-12-06 12:53:50 UTC
(In reply to comment #12)
> The fixed code is there from time of NB 6.0. Maybe some thread ordering
> changed, but it's hard to say with lazy projects.

So leaving for the patch ...
Comment 15 anli 2012-01-15 20:55:06 UTC
I have built the IDE from main-golden. Unfortunately the issue still exists with absolutely the same symptoms.
Comment 16 Jiri Prox 2012-01-16 09:03:23 UTC
Can you please capture new thread dump and attach it here? 
Thanks
Comment 17 Tomas Zezula 2012-01-16 09:07:00 UTC
This deadlock cannot happen as the caller thread does not hold any lock.
If you have deadlock it's probably some other problem. Please attach a stack trace.
Comment 18 anli 2012-01-16 09:38:00 UTC
Created attachment 114927 [details]
thread dump on deadlock, after fix, from golden

The next thread dump is attached. Just the only editor tab was opened with htm-file.

As far as I'm not sure why reopened bug was closed, I don't reopen it again :-)
Comment 19 Tomas Zezula 2012-01-16 09:55:54 UTC
The bug was closed as it's fixed :-)
According to the new stack trace you have a deadlock in Scala support plugin.

The relevant stack trace where locks are taken in wrong order is:

at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:200)
        at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
        at org.netbeans.modules.scala.project.MainClassUpdater.addFileChangeListener(MainClassUpdater.java:227)
        at org.netbeans.modules.scala.project.MainClassUpdater.<init>(MainClassUpdater.java:110)
        at org.netbeans.modules.scala.project.J2SEProject$ProjectOpenedHookImpl.projectOpened(J2SEProject.java:560)

So I will create a new issue on Scala later today and add you on CC.
Comment 20 anli 2012-01-16 10:07:27 UTC
(In reply to comment #19)
> So I will create a new issue on Scala later today and add you on CC.

Thanks!
Comment 21 Tomas Zezula 2012-01-16 17:08:33 UTC
I've created a new issue for NB-Scala http://java.net/bugzilla/show_bug.cgi?id=3575
Comment 22 anli 2012-01-16 17:31:04 UTC
Tomas,

I'm not registered at java.net, but I have tried your patch for Scala plugin - the problem has gone, thanks!
Comment 23 Jiri Prox 2012-02-06 13:33:24 UTC
verified
Comment 24 Tomas Zezula 2012-02-10 11:00:47 UTC
Integrated into release71_fixes: 4a2ec826d093, 6560382c51b3
Comment 25 Quality Engineering 2012-02-11 02:53:05 UTC
Integrated into 'releases', will be available in build *201202102200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/4a2ec826d093
User: Tomas Zezula <tzezula@netbeans.org>
Log: #205859:deadlock on projects scanning


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