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 135206 - IDE freeze during the first startup
Summary: IDE freeze during the first startup
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords:
: 135425 135560 135908 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-16 10:58 UTC by Lukas Jungmann
Modified: 2008-06-19 20:08 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
thread dump (24.29 KB, text/plain)
2008-05-16 10:58 UTC, Lukas Jungmann
Details
thread dump 200805150003 installer build , jbaker (27.58 KB, text/plain)
2008-05-16 22:12 UTC, John Baker
Details
thread dump from "closed" IDE (23.52 KB, text/plain)
2008-05-18 17:18 UTC, Lukas Jungmann
Details
thread dump (51.38 KB, text/plain)
2008-05-20 19:44 UTC, Dan Kolar
Details
thread dump (49.94 KB, text/plain)
2008-05-22 13:57 UTC, Dan Kolar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2008-05-16 10:58:07 UTC
netbeans-hudson-trunk-1944-javaee.zip, jdk6_u6

-start IDE with fresh userdir

=> IDE becomes unresponsive

Reproducible for me on winxp-64b (+MySQL), vista, ubuntu (+MySQL)


Workaround seems to be to restart the IDE (usually 3rd and later starts are OK)
Comment 1 Lukas Jungmann 2008-05-16 10:58:35 UTC
Created attachment 61474 [details]
thread dump
Comment 2 David Vancouvering 2008-05-16 14:30:21 UTC
Hi, Jungi.  This looks like a known bug, which I thought I had fixed on May 13, see issue 134577.  I can't tell from
your report the date of the build, so I don't know if this is this means you need a new build or the bug was not
correctly fixed.
Comment 3 Lukas Jungmann 2008-05-16 14:34:25 UTC
Hi David, this build is from todays morning CET. Hudson says: Build #1944 (16.5.2008 7:33:47)[1]


[1]: http://deadlock.netbeans.org/hudson/job/trunk/1944/
Comment 4 Lukas Jungmann 2008-05-16 15:05:30 UTC
same is happening for Jarda who uses its own build from sources which were fetched 3-4hours ago...
Comment 5 John Baker 2008-05-16 22:10:48 UTC
I could reproduce using today's installer build using JDK 1.6.0_02
The "Looking for a local MySQL database server" task was blocked - progress bar not moving.

I could not reproduce using JDK 1.5

Comment 6 John Baker 2008-05-16 22:12:37 UTC
Created attachment 61506 [details]
thread dump 200805150003 installer build , jbaker
Comment 7 John Baker 2008-05-16 22:25:19 UTC
this seems to be different issue than 134577

Can lookupDatabaseServer be executed in another thread instead of blocking with synchronized?
Comment 8 John Baker 2008-05-16 23:12:38 UTC
pls disregard my previous comment.  My workspace was not up-to-date.

Comment 9 John Baker 2008-05-16 23:19:32 UTC
But I think the problem is in getDatabaseServer() where there are multiple clients trying to retrieve
a DatabaseServer.  So, as the comment states in getDatabaseServer, this needs to support concurrent access

Comment 10 David Vancouvering 2008-05-17 06:22:20 UTC
Thanks for looking at this John.  I'll be offline (in airplane), but I'll be working on this.
Comment 11 David Vancouvering 2008-05-17 07:26:29 UTC
Here's what I think I'm seeing:

The folder recognizer is doing a lookup which causes the DB root node to initialize itself.

But as part of DB root node initialization, it ultimately calls ServerNodeProvider.checkNodeArray(), which itself does a
lookup of the DatabaseServer.

I had tried to eliminate this kind of double-lookup by moving the lookup of DatabaseServer to
ServerNodeProvider.getNodes(), but obviously to no avail.

The longer-term solution is to fix the RootNode initialization so it doesn't do lookups on the same thread in which it
is initialized, as this happens as part of a lookup. The child initialization should happen asynchronously on another
thread and notify the node tree when it is complete.

In the meantime I may eliminate doing lookups inside db.mysql to avoid circular lookups, and instead hardcode the
DatabaseServer instance to be a MySQLDatabaseServer implementation.


Comment 12 Lukas Jungmann 2008-05-18 17:16:35 UTC
Hi David, did you change anything in the DB code?

I'm asking because in javaee build #1964 (18.5.2008 13:12:08 CET) I cannot reproduce UI freeze but I can't see _any_
nodes in services tab - there's no servers, dbs, webservices etc. node there (that would be just another P1...)

Also when I try to close the IDE I get an info about still running Registering local JavaDB process and when I dismiss
the dialog with this info JVM is still running and I have to KILL it...
Comment 13 Lukas Jungmann 2008-05-18 17:18:11 UTC
Created attachment 61534 [details]
thread dump from "closed" IDE
Comment 14 David Vancouvering 2008-05-18 20:25:47 UTC
Yes, I changed something, and obviously still not working.   Working on a fix.
Comment 15 John Baker 2008-05-19 09:17:14 UTC
http://hg.netbeans.org/main/rev/0a9b2449aa8d

applied David's suggestion
Comment 16 Quality Engineering 2008-05-20 05:21:59 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #206 build
Changeset: http://hg.netbeans.org/main/rev/0a9b2449aa8d
User: John Baker <jbaker@netbeans.org>
Log: #135206 IDE freeze during the first startup; temporary fix
Comment 17 David Vancouvering 2008-05-20 16:51:45 UTC
*** Issue 135425 has been marked as a duplicate of this issue. ***
Comment 18 Dan Kolar 2008-05-20 19:43:31 UTC
I just updated sources and still can reproduce the bug.
Comment 19 Dan Kolar 2008-05-20 19:44:44 UTC
Created attachment 61640 [details]
thread dump
Comment 20 John Baker 2008-05-20 20:03:21 UTC
Could you try the latest nightly trunk build also.  It's possible your sources are not up-to-date





Comment 21 David Vancouvering 2008-05-20 20:30:18 UTC
If you look at the change set John checked in, we no longer call lookupDatabaseServer

@ -67,7 +68,7 @@ public class DatabaseServerManager {
//
// TODO - fix the DB Explorer so it refreshes its children
// on a separate thread, so we don't get into this situation.
- DatabaseServer server = lookupDatabaseServer();
+ DatabaseServer server = MySQLDatabaseServer.getDefault();

but in the stack trace you posted, the call to lookupDatabaseServer is still there.

[ideTestRunner]         at
org.netbeans.modules.db.mysql.DatabaseServerManager.lookupDatabaseServer(DatabaseServerManager.java:58)
[ideTestRunner]         at org.netbeans.modules.db.mysql.DatabaseServerManager.<clinit>(DatabaseServerManager.java:51)


So you must somehow be running off of old sources...  Can you please try again?

Thanks!

David
Comment 22 Jana Maleckova 2008-05-21 09:26:41 UTC
Hi, this happens on Build 20080520224434 from hudson #1993(22:44) as well
Comment 23 David Vancouvering 2008-05-21 12:12:10 UTC
Hi, Janie.  Can you please post a thread dump when it hangs?   Thanks.
Comment 24 David Vancouvering 2008-05-21 22:40:13 UTC
*** Issue 135560 has been marked as a duplicate of this issue. ***
Comment 25 David Vancouvering 2008-05-22 13:12:52 UTC
dkolar: can you reproduce from the latest build?
janie: can you please give me a thread dump? 

Marking incomplete because I can't reproduce and the stack traces so far represent the code tree before the fix.
Comment 26 Dan Kolar 2008-05-22 13:56:39 UTC
After the fix it doesn't happen 90% of the time, but only about 25%. I'm attaching the dump, but even I've my sources up
to date, the dump is pretty similar to previous one.
Comment 27 Dan Kolar 2008-05-22 13:57:43 UTC
Created attachment 61759 [details]
thread dump
Comment 28 John Baker 2008-05-22 14:16:21 UTC
Please list the new steps to reproduce the 25% of the time freeze
Comment 29 David Vancouvering 2008-05-22 14:35:47 UTC
OK, I found the problem, the DEFAULT member variable is being initialized with lookupDatabaseServer().

I'll check in a fix and this should finally be resolved.
Comment 30 John Baker 2008-05-22 15:58:22 UTC
See if this fixes the freeze - from David's suggestion
I could not reproduce the freeze while testing this fix.

http://hg.netbeans.org/main/rev/c3b9a4df4b69
Comment 31 Dan Kolar 2008-05-23 10:03:32 UTC
Well, now it seems to be ok finally.
Comment 32 Quality Engineering 2008-05-27 16:28:43 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #221 build
Changeset: http://hg.netbeans.org/main/rev/c3b9a4df4b69
User: John Baker <jbaker@netbeans.org>
Log: #135206  IDE freeze during the first startup
Comment 33 John Baker 2008-05-28 05:21:07 UTC
*** Issue 135908 has been marked as a duplicate of this issue. ***
Comment 34 Roman Mostyka 2008-06-03 17:09:38 UTC
Verified.