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 211107 - [profiler] Can not stop a server instance started in profiling mode and waiting for the profiler client to attach
Summary: [profiler] Can not stop a server instance started in profiling mode and waiti...
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.1.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: piotrik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-12 13:48 UTC by J Bachorik
Modified: 2012-05-10 11:58 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description J Bachorik 2012-04-12 13:48:53 UTC
Steps to reproduce:
1. Select a GF3 instance node
2. Invoke "Start in Profile Mode" action from the popup menu
3. The GF3 starts in profile mode (eg. JVM is blocked waiting for the client to attach) and there is no way to stop it.

The only solution to this is to kill -9 the glassfish process.

FYI all the other server plugins handle such situation well and leave the stop button enabled to kill the waiting GF3 instance.
Comment 1 Vince Kraemer 2012-04-19 19:29:04 UTC
Peter noted that there is code somewhere that it editing the domain.xml file to include profiler info.  It doesn't look like it is gf plugin code.  I am not sure we want to allow the user to end up with an edited domain.xml file.

If we enable the stop action we need to have some way to link the processes created using the start action/task and the stop action/task.  Currently they are not linked.
Comment 2 J Bachorik 2012-04-20 09:21:02 UTC
Definitely not the case in the current implementation. The profiling specific JVM args are injected using StartupExtender (see #206196) and starting the server in profiling mode does not involve any shady domain.xml modifications. I've checked the domain.xml file for a server started in profiling mode and there is no modification regarding profiler what so ever.

The only place where a domain.xml might be modified is the profiler attach wizard but it is done on a user's request.
Comment 3 piotrik 2012-04-20 15:00:57 UTC
As Jarda said, the domain.xml is edited by attach profiler wizard in the latest steps. These steps are considered for users who know what they are doing. However, the wizard is not warning about that and I as a not really experienced user of NetBeans have always ended up with edited domain.xml. After that the glassfish starts in profile mode also when you run it normally or in a debug mode.
Vince, Jarda said that in previous versions was possible to stop the server in profiling mode but I didn't see that in repository. Do you remember if it is possible to find it somewhere or we have to implement it from scratch.
Comment 4 Vince Kraemer 2012-04-20 16:51:15 UTC
(In reply to comment #3)
> As Jarda said, the domain.xml is edited by attach profiler wizard in the latest
> steps. These steps are considered for users who know what they are doing.
> However, the wizard is not warning about that and I as a not really experienced
> user of NetBeans have always ended up with edited domain.xml. After that the
> glassfish starts in profile mode also when you run it normally or in a debug
> mode.

I was able to get to the point where the domain.xml file was edited.  

> Vince, Jarda said that in previous versions was possible to stop the server in
> profiling mode but I didn't see that in repository. Do you remember if it is
> possible to find it somewhere or we have to implement it from scratch.

That might have been in the v2 plugin.  I do not remember the stop action being enabled while the server is starting with the v3 plugin... ever.

the trick is to find an object that corresponds to the server instance that is 'shared' between the StartServerAction and the StopServerAction.  That is likely to be the CommonServerSupport object that is the GlassFish module. We probably need to add a 'process' field on that object which will get passed to the StopTask if the server is in starting state...
Comment 5 Vince Kraemer 2012-04-20 23:54:14 UTC
Peter: I have assigned this to you for now.
Comment 6 piotrik 2012-05-02 08:19:51 UTC
Added support for shutting down server waiting for profiler.
Comment 7 Quality Engineering 2012-05-04 09:53:08 UTC
Integrated into 'main-golden', will be available in build *201205040400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/701d94ada78a
User: Peter Benedikovic <piotrik@netbeans.org>
Log: #211107: Profiling mode can be now stopped before attaching profiler