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 168858 - deadlock while creating new web project
Summary: deadlock while creating new web project
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 6.x
Hardware: Sun All
: P1 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
: 168795 168872 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-21 10:26 UTC by Jindrich Sedek
Modified: 2009-07-27 10:11 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
threaddump (23.41 KB, text/plain)
2009-07-21 10:27 UTC, Jindrich Sedek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Sedek 2009-07-21 10:26:27 UTC
I used new project wizard to create a web project, after pressing finish on frameworks tab, deadlock appeard see 
attached thread dump
Comment 1 Jindrich Sedek 2009-07-21 10:27:30 UTC
Created attachment 84980 [details]
threaddump
Comment 2 Jindrich Sedek 2009-07-21 10:38:10 UTC
I'm able to reproduce reliably and I'm not able to create new web project -> P1
Comment 3 Jindrich Sedek 2009-07-21 12:09:57 UTC
*** Issue 168872 has been marked as a duplicate of this issue. ***
Comment 4 David Konecny 2009-07-21 12:17:52 UTC
I don't think that NodeFactorySupport.DelegateChildren.addKeys method should be called from sychronization(keys).
Comment 5 David Konecny 2009-07-21 12:38:12 UTC
Are you sure about P3 Milos? From description and the duplicate it looks like it happens fairly often.
Comment 6 David Konecny 2009-07-21 13:35:38 UTC
I just saw it happened for other people. I wonder what has changed that it happens so often now?
Comment 7 pslechta 2009-07-21 16:03:58 UTC
Please fix this deadlock -- it is real stopper (IMHO) for NB 6.8 M1. It also stops me from development/bug fixing...
Thanks!
Comment 8 Vince Kraemer 2009-07-21 16:23:29 UTC
I saw a similar deadlock earlier this morning...  I did not file it since I figured (correctly) it would have been filed
by someone already
Comment 9 Milos Kleint 2009-07-22 08:11:18 UTC
http://hg.netbeans.org/main/rev/6445d4d41946 attempts to read the keys from the node providers off the keys lock.
However the lock *is* necessary unlike suggested by dkonecny.

<rant>
pslechta: how can something that is present in 6.7 (see version reported against) be a stopper for 6.8 M1? Next time I
see such a statement I'm tempted to test your theory by not fixing the issue and see what happens.
</rant>

Anyway, I believe the primary problem is in the rest services support whcih should not fire changes under the lock,
mutex or whatever there is in java support/annotation helper.
Comment 10 Jindrich Sedek 2009-07-22 08:30:45 UTC
it's not 6.7 problem - I set up incorrect version. I'm sorry for confusion
Comment 11 pslechta 2009-07-22 08:47:30 UTC
Is it common to handle bugs by not fixing them and just waiting what happens? (Thanks for your explanation, now I really
understand some of NB problems...) In NB 6.8, nobody can create web project anymore. IDE is not useful. (And I cannot
test my code, thus I can go home...)

Was the problem introduced by some change in websvc? Or somewhere else? I use NB 6.8 for testing all the time it exists,
but never had this problem before.
Comment 12 David Konecny 2009-07-22 08:48:35 UTC
I'm going to have a look at WS code.
Comment 13 Lukas Jungmann 2009-07-22 08:57:33 UTC
this could have been masked or could be consequence of fix for issue 167613 (which was resolved as a dup of issue
168388) (just a guess but this started to happen after the fix)
Comment 14 pslechta 2009-07-22 09:18:08 UTC
The following change removes the deadlock, but some assertions are not happy... I'm going to use it as my local
workaround to be able to work on the code...

--- a/websvc.rest/src/org/netbeans/modules/websvc/rest/nodes/RestServicesNodeFac
tory.java       Wed Jul 22 06:34:48 2009 +0400
+++ b/websvc.rest/src/org/netbeans/modules/websvc/rest/nodes/RestServicesNodeFac
tory.java       Wed Jul 22 10:14:53 2009 +0200
@@ -136,7 +136,6 @@
                                         result.add(NO_SERVICES);
                                     }

-                                    fireChange();
                                     return null;
                                 }
                             });
@@ -145,6 +144,7 @@
                         }
                     }
                 });
+                fireChange();
             }
             return Collections.emptyList();
         }
Comment 15 Milos Kleint 2009-07-22 09:40:35 UTC
"Is it common to handle bugs by not fixing them and just waiting what happens? (Thanks for your explanation, now I really
understand some of NB problems...) In NB 6.8, nobody can create web project anymore. IDE is not useful. (And I cannot
test my code, thus I can go home...)"

Is it common to avoid work by claiming "objective difficulties"? There are numerous ways to workaround the deadlock,
even if it happens every time you create a web project.

I don't like people trying to get ahead of the queue. Neither in hospital, nor in issuezilla. Period. Please avoid the
comments you had in the issue next time, it will not lead you anywhere with me, that's the message I tried to bring across.

Comment 16 David Konecny 2009-07-22 10:25:22 UTC
Guys, no need to get upset. Although I'm having difficulties following what has caused it.

I fixed it in http://hg.netbeans.org/web-main/rev/33fcd34438ea by removing firing of events under Java lock and pslechta
verified it.

I still do think that calling foreign code under a private lock (as NodeFactorySupport.DelegateChildren.addKey does) is
dangerous and should be avoided if possible.
Comment 17 Quality Engineering 2009-07-23 07:44:53 UTC
Integrated into 'main-golden', will be available in build *200907230201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6445d4d41946
User: Milos Kleint <mkleint@netbeans.org>
Log: #168858 get the list of keys off the "keys" lock. might prevent some cases of deadlocks
Comment 18 Jindrich Sedek 2009-07-24 10:15:21 UTC
verified.
NetBeans IDE Dev (Build 200907240201)
Comment 19 Milan Kuchtiak 2009-07-27 10:11:57 UTC
*** Issue 168795 has been marked as a duplicate of this issue. ***