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 142622 - NetBeans creates too many MySQL processes
Summary: NetBeans creates too many MySQL processes
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: MySQL (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-01 18:57 UTC by Roman Mostyka
Modified: 2008-08-19 13:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of "Windows Task Manager" with 2 mysqld.exe processes. (55.17 KB, image/jpeg)
2008-08-05 12:46 UTC, Roman Mostyka
Details
Screenshot of "Windows Task Manager" with 2 mysqld.exe processes and no message in Output window. (99.28 KB, image/jpeg)
2008-08-13 11:53 UTC, Roman Mostyka
Details
Screenshot of "Admin Properties" tab. (35.86 KB, image/jpeg)
2008-08-14 16:23 UTC, Roman Mostyka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-08-01 18:57:47 UTC
1. Start IDE.
2. Add MySQL server and start it. Process is running.
3. Close IDE and then reopen it.
4. Rightclick MySQL server node and choose "Start".

Result: Another MySQL process is running. After some time of work there will be lack of memory.
Comment 1 David Vancouvering 2008-08-01 19:08:46 UTC
Please provide more information about your environment.  You shouldn't be able to start multiple MySQL processes,
because the second and following ones will fail after detecting the network connection is already in use by the first
one.  The only thing I can think of is that the process NetBeans starts to start the MySQL process never exits, so if
you keep on clicking "Start" we keep on creating new processes.

Why on earth would a user do this?  Why do you believe this is a P2?
Comment 2 Roman Mostyka 2008-08-04 10:45:34 UTC
Product Version: NetBeans IDE Dev (Build 080802)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)
I always can reproduce this issue. Draw attention to point 3). You should restart IDE.
I think that it is P2 since it can be the reason of lack of memory. Since IDE after long work starts often to be slow,
then user may want to restart it and start MySQL again. And user won't see that there are many MySQL processes. This is
also performance issue.
Comment 3 David Vancouvering 2008-08-04 22:38:20 UTC
Sorry, I still don't get it.  Why would someone try to restart the MySQL process each time they start the IDE?  What do
you mean by "another MySQL process?"  What platform are you running on?  How do you determine that another process is
running?  Can you show me for example the output of 'ps' or a screen shot of the Windows task manager?

David
Comment 4 Roman Mostyka 2008-08-05 12:44:23 UTC
Why would someone try to restart the MySQL process each time they start the IDE?
Nobody try. Just restart IDE and MySQL is still looks like stopped. Then user rightclick MySQL server node and choose
"Start". At least for me, second mysqld.exe process is running.

What do you mean by "another MySQL process"? How do you determine that another process is running?  Can you show me for
example the output of 'ps' or a screen shot of the Windows task manager?
I mean another mysqld.exe process. I see it in Windows task manager. See screenshot in attach.

What platform are you running on? 
Windows XP.
Comment 5 Roman Mostyka 2008-08-05 12:46:27 UTC
Created attachment 66584 [details]
Screenshot of "Windows Task Manager" with 2 mysqld.exe processes.
Comment 6 Andrei Badea 2008-08-11 16:34:14 UTC
Taking over.
Comment 7 Andrei Badea 2008-08-11 22:08:00 UTC
It seems this happen when the InnoDB engine is enabled. The second mysqld process keeps trying to lock the InnoDB files,
which it can't because the first process has locked them. The second process also displays a warning message pointing to
the likely cause (that another MySQL instance is running), but not on the console unless started with the "--console"
argument. When InnoDB is not enabled the second process aborts because it can't listed on port 3306.

Still evaluating the fix, but my ideas are along the lines of adding "--console" as a default argument to mysqld. This
would cause the error message to be displayed in the MySQL output window, informing the user that there is a problem.
Comment 8 Andrei Badea 2008-08-12 13:41:09 UTC
d8c9590b5377
Comment 9 Roman Mostyka 2008-08-12 18:49:34 UTC
Do the same for MySQL 5.1 since your change affects only MySQL 5.0 and I still can create more than one MySQL process
for MySQL 5.1
Comment 10 David Vancouvering 2008-08-12 19:16:57 UTC
Fixed
Comment 11 Andrei Badea 2008-08-13 10:09:01 UTC
The change should affect both MySQL 5.0 and 5.1. Yes, the second process is always created, just as if you had started
it manuallyl using mysqld. The change just displays the MySQL log in the MySQL Output window, informing the user that
there is a problem (another MySQL instance is running, or the server could not start, depending on whether the InnoDB
engine is enabled -- cf. desc8).
Comment 12 Roman Mostyka 2008-08-13 11:53:34 UTC
Created attachment 67243 [details]
Screenshot of "Windows Task Manager" with 2 mysqld.exe processes and no message in Output window.
Comment 13 Roman Mostyka 2008-08-13 12:09:44 UTC
I don't see any message.
The problem can be that 5.0 has for Windows mysqld-nt.exe process, but MySQL 5.1 just mysqld.exe.
Comment 14 Andrei Badea 2008-08-13 17:17:27 UTC
Please attach a screenshot of the "Admin Properties" tab of the MySQL Server Properties dialog.
Comment 15 Quality Engineering 2008-08-14 15:56:58 UTC
Integrated into 'main-golden', available in build *200808141419* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/d8c9590b5377
User: Andrei Badea <abadea@netbeans.org>
Log: #142622: NetBeans creates too many MySQL processes
Comment 16 Roman Mostyka 2008-08-14 16:23:18 UTC
Created attachment 67432 [details]
Screenshot of "Admin Properties" tab.
Comment 17 Roman Mostyka 2008-08-14 16:25:05 UTC
Note that MySQL 5.1 doesn't have mysqld-nt.exe file and admin properties were set by me, since it isn't bundled MySQL,
but standalone.
Comment 18 Andrei Badea 2008-08-14 21:59:03 UTC
The "--console" parameter to mysqld is not present. It should have been added when the server was detected. But perhaps
the server was detected by an old build, which did not add the "--console" parameter. Please remove your userdir and try
again. Is there a "--console" parameter? Thanks.
Comment 19 Andrei Badea 2008-08-14 22:07:55 UTC
> admin properties were set by me, since it isn't bundled MySQL, but standalone.

But did NetBeans detect the server, or not? If it didn't, and you just registered the server manually, then I'm sorry,
but there is nothing I can do to help. It is just as starting mysqld multiple times -- an user error.
Comment 20 Roman Mostyka 2008-08-15 10:45:38 UTC
With "--console" parameters everything looks better. But MySQL wasn't detected automatically.
And starting mysqld multiple times isn't an user error. The user don't know that MySQL has been started and NetBeans
also doesn't reflect this.
If that's all we can do, then this issue is fixed.
Comment 21 Andrei Badea 2008-08-15 13:40:28 UTC
> The user don't know that MySQL has been started

I think most users do know the state of their server, so the impact of the issue is not so big after all.

> If that's all we can do, then this issue is fixed.

Closing then.
Comment 22 Roman Mostyka 2008-08-19 13:47:24 UTC
Verified with build 080819.