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 203937 - IDE kills unresponsive GlassFish process after 2 minutes
Summary: IDE kills unresponsive GlassFish process after 2 minutes
Status: RESOLVED INCOMPLETE
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.0.1
Hardware: PC Windows Vista
: P2 normal (vote)
Assignee: Vince Kraemer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-19 05:22 UTC by bht
Modified: 2011-11-08 15:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Dialog (15.53 KB, image/gif)
2011-10-19 20:14 UTC, bht
Details
logs in zip file (98.65 KB, application/octet-stream)
2011-10-19 20:16 UTC, bht
Details
logs in zip file (63.57 KB, application/octet-stream)
2011-11-05 20:09 UTC, bht
Details
log files as cross check (60.08 KB, application/zip)
2011-11-06 17:45 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2011-10-19 05:22:15 UTC
IDE kills healthy GlassFish during Startup

When I start GlassFish in Debug mode after a computer and IDE start, then the IDE kills it most of the time.

In the IDE's server log (not in the actual server log), there is an entry

INFO [glassfish]: V3 Failed to start, killing process: java.lang.ProcessImpl@14447ac after 122,875

And there is a corresponding dialog box.

In the server properties I cannot find a configurable timeout value, so I assume this is hard-coded.

Which I think is very strange - this must be classified as bug. Please do not waste my time unnecessarily. I hope that this can somehow be fixed - I definitely hope this is not a JDK limitation.
Comment 1 Vince Kraemer 2011-10-19 13:07:15 UTC
please provide more detailed instructions on how to reproduce this issue.  step by step would be helpful...

One question that I have... do you have breakpoints set? where are they?
Comment 2 Vince Kraemer 2011-10-19 13:41:16 UTC
could you attach the IDE log and the server log... it might have useful info.
Comment 3 Vince Kraemer 2011-10-19 16:53:11 UTC
what is the text in the dialog box?
Comment 4 bht 2011-10-19 20:14:10 UTC
Created attachment 112233 [details]
Dialog
Comment 5 bht 2011-10-19 20:16:38 UTC
Created attachment 112235 [details]
logs in zip file

This time I started the server before scanning was completed so the warning message is not the last one in the log as before.
Comment 6 bht 2011-10-19 20:32:16 UTC
Breakpoints: Good question. Deleted all breakpoints and the problem disappears.
Comment 7 bht 2011-10-19 20:53:28 UTC
The problem reproduces with a single valid breakpoint added to the first line of code in the init() method of a Wicket Application which in my case is the only application that is deployed on the server.
Comment 8 Vince Kraemer 2011-10-19 21:26:48 UTC
here is a rough outline of the 'why does this happen'...

NB detects that the server is really 'up and running' by getting responses to some rest commands.  The BP in the init delays processing the start-up completion, so NB never gets the responses that 'say', "Hey, I am started and ready to go". The GF integration code eventually decides that something really bad has happened to the server and it shoots the process... since it thinks it is dead...

I can try to extend the 'are you alive' check to figure out that the server might be 'stuck' in a bp and treat the start-up as successful.
Comment 9 Vince Kraemer 2011-10-24 20:05:04 UTC
web-main : 4fb337c781de
Comment 10 Quality Engineering 2011-10-25 14:37:33 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/4fb337c781de
User: vince kraemer <vkraemer@netbeans.org>
Log: #203937 : a well/poorly placed BP can force NB to give up on starting the server in Debug mode.
Comment 11 Vince Kraemer 2011-10-25 16:06:23 UTC
in the published dev builds
Comment 12 bht 2011-11-05 20:08:10 UTC
It is back. Please refer to the attached log files.
Comment 13 bht 2011-11-05 20:09:25 UTC
Created attachment 112872 [details]
logs in zip file
Comment 14 bht 2011-11-05 20:22:56 UTC
This time, there were no applications deployed on it at all. IMHO we can't do without user confirmation the opposite of what the user is asking us to do. Would you please consider this as a guiding principle. It makes life a lot easier.
Comment 15 Vince Kraemer 2011-11-05 23:50:18 UTC
In http://netbeans.org/bugzilla/show_bug.cgi?id=203937#c1, I asked for detailed steps to reproduce this issue...

They were not provided, but we made some progress.

Now, they are a bit more critical... since it seems like we may have fixed a different problem.
Comment 16 bht 2011-11-06 00:18:28 UTC
To reproduce the issue, the conditions are now greatly simplified.

Prior to the test, I ensure that no applications are deployed on GlassFish.

Then I start NetBeans with an empty userdir for the first time and then I start GlassFish in debug mode.

IMHO it is perfectly acceptable that GF takes 2 minutes, even much more for a cold startup and I don't want to distract us from the main issue that it is not NetBeans' business to stop it when the user wants to start it. The server would have started ok without the cut-off.

Why do we try to find out the conditions? Going down this route one could of course fix any number of problems while new ones keep popping up. Not very efficient.
Comment 17 Vince Kraemer 2011-11-06 05:53:04 UTC
Thanks for the additional information.
Comment 18 Vince Kraemer 2011-11-06 16:19:33 UTC
I just want to double check one thing...

I noticed that the server and IDE logs appear to be skewed...

The NB log starts 'Sunday, November 6, 2011 6:37:52 AM NZDT'

I see activity on 2011-11-06 in the server log file... but it shows up as '2011-11-06T09:04:44.375+1300'

Did you take a long pause between starting NB and starting GF or am I looking at the wrong set of server log entries?
Comment 19 bht 2011-11-06 17:45:42 UTC
Created attachment 112881 [details]
log files as cross check

I don't thing there was any such time offset during my testing.

Another set of log files. This time the server refused to start because of an unavailable port. Perhaps it is starting more than once?

SEVERE: Shutting down v3 due to startup exception : No free port within range: 4848=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@126172f
INFO: Server shutdown initiated
INFO: Already stopped, so just returning

I tried again and it worked.
Comment 20 Vince Kraemer 2011-11-07 21:27:06 UTC
I downloaded https://netbeans.org/bugzilla/attachment.cgi?id=112881 (log files as cross check) and am a bit perplexed...

The NB log is dated November 5, 2011...  The GF log has entries from 2011-11-07 that match what you describe in https://netbeans.org/bugzilla/show_bug.cgi?id=203937#c19.

Did I miss something?
Comment 21 bht 2011-11-08 07:49:51 UTC
My apologies. I was sloppy. I might taken a log file from a different userdir. How can I increase the number of ide log generations from 3 to say 30?

Meanwhile I tried to reproduce but I can't. I will keep watching it. I close this now until I have further information.

One other thing I noticed is that after NetBeans is closed, and the server was running (started by it), than the server keeps running for quite some time, or whatever that is that listens on port 4848, but that is beside the point:

netstat -a


Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    tower:epmap            tower:0                LISTENING
  TCP    tower:microsoft-ds     tower:0                LISTENING
  TCP    tower:1025             tower:0                LISTENING
  TCP    tower:1036             tower:0                LISTENING
  TCP    tower:1038             tower:0                LISTENING
  TCP    tower:1041             tower:0                LISTENING
  TCP    tower:3690             tower:0                LISTENING
  TCP    tower:5432             tower:0                LISTENING
  TCP    tower:1037             tower:0                LISTENING
  TCP    tower:1037             tower:1038             ESTABLISHED
  TCP    tower:1038             tower:1037             ESTABLISHED
  TCP    tower:1040             tower:0                LISTENING
  TCP    tower:1040             tower:1041             ESTABLISHED
  TCP    tower:1041             tower:1040             ESTABLISHED
  TCP    tower:1068             tower:1069             TIME_WAIT
  TCP    tower:1072             tower:1073             TIME_WAIT
  TCP    tower:1074             tower:1075             TIME_WAIT
  TCP    tower:1076             tower:4848             TIME_WAIT
  TCP    tower:1077             tower:8686             TIME_WAIT
  TCP    tower:1078             tower:8686             TIME_WAIT
  TCP    tower:1082             tower:1083             TIME_WAIT
  TCP    tower:1085             tower:0                LISTENING
  TCP    tower:5152             tower:0                LISTENING
  TCP    tower:12025            tower:0                LISTENING
  TCP    tower:12080            tower:0                LISTENING
  TCP    tower:12110            tower:0                LISTENING
  TCP    tower:12119            tower:0                LISTENING
  TCP    tower:12143            tower:0                LISTENING
  TCP    tower:12465            tower:0                LISTENING
  TCP    tower:12563            tower:0                LISTENING
  TCP    tower:12993            tower:0                LISTENING
  TCP    tower:12995            tower:0                LISTENING
  UDP    tower:microsoft-ds     *:*                    
  UDP    tower:1033             *:*
Comment 22 Quality Engineering 2011-11-08 15:40:57 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/e198970a06a3
User: vince kraemer <vkraemer@netbeans.org>
Log: #203937 : startup seems to get tripped up by using ServerSocket to check for a running server...  NB has the socket when GF needs it.