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 229365 - Can't close IDE after stopping all processes (was: After Windows sleep, can't close the IDE)
Summary: Can't close IDE after stopping all processes (was: After Windows sleep, can't...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: issues@javaee
URL:
Keywords:
: 230623 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-05-05 15:23 UTC by ecerichter
Modified: 2013-06-22 05:12 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (399.02 KB, text/plain)
2013-05-05 15:23 UTC, ecerichter
Details
Video of the issue. (8.13 MB, application/zip)
2013-05-17 14:38 UTC, ecerichter
Details
DEV 20130616: Log with the -J-Dorg.netbeans.core.NbLifecycleManager.level=FINE (240.72 KB, application/octet-stream)
2013-06-18 11:31 UTC, ecerichter
Details
DEV 201306162301 - Video showing the issue (5.52 MB, video/avi)
2013-06-18 11:32 UTC, ecerichter
Details
DEV 20130616: Thread dump (31.33 KB, application/octet-stream)
2013-06-18 11:33 UTC, ecerichter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ecerichter 2013-05-05 15:23:30 UTC
Product Version = NetBeans IDE Dev (Build 201305022300)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_17
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.7-b01

The only workaround is to kill the process using Windows Task Manager.
Comment 1 ecerichter 2013-05-05 15:23:41 UTC
Created attachment 134113 [details]
IDE log
Comment 2 Marian Mirilovic 2013-05-07 06:31:58 UTC
The only exception I see in the log is from java/source .. so reassigning
Comment 3 Jan Lahoda 2013-05-07 07:55:59 UTC
The exception is a duplicate of bug #226250. I don't see how it could prevent stopping the IDE - sending to platform for evaluation.
Comment 4 Libor Fischmeistr 2013-05-17 08:31:07 UTC
I don't think this is problem of the launcher. I cannot reproduce this bug. Because issue 226250 does not occur for me, IDE can successfully close after Windows sleep. I think it's related to java/source or maybe even to JDK.
Comment 5 Jan Lahoda 2013-05-17 09:42:20 UTC
(In reply to comment #4)
> I don't think this is problem of the launcher. I cannot reproduce this bug.
> Because issue 226250 does not occur for me, IDE can successfully close after
> Windows sleep. I think it's related to java/source or maybe even to JDK.

I don't see an evidence it is related to java.source, as I don't see any evidence it is related to JDK (and, BTW, there is a component for JDK problems under platform product).

I do see an evidence of poor robustness in platform, however: whatever happens, ignoring shutdown request and not telling the user why is clearly a bug, and a platform that would strive to be convenient for its users would at least log a warning if there would not be any other possible option. In general, one the few ways I see to prevent shutdown is overriding ModuleInstall.closing. The list of all overriders of this method is available here:
http://lahoda.info/index/ui/index.html#/usages?signature=METHOD:org.openide.modules.ModuleInstall:closing:%28%29Z

You might find it entertaining that java.source is not on this list.

Anyway, I am not going to play ping-pong in bugzilla. Reporter, I don't think anyone can even start to evaluate without a thread dump (at least some of the reasons for not stopping should be visible from it). So when this happens next, please make one and attach it here, thanks.
Comment 6 Libor Fischmeistr 2013-05-17 14:00:58 UTC
Sorry for mistake, I thought JVM, no JDK... I don't think IDE causes that it cannot be closed after Windows sleep.
Comment 7 ecerichter 2013-05-17 14:21:17 UTC
I've just discovered that the problem is not the computer Sleep.

Steps to reproduce the problem with DEV 201305092300:

1) Open web app project
2) Right click, debug project
3) Wait project to start
4) Click in "close" button (top right)
5) NetBeans warns that there are process running, and they will be closed
6) Click in "Cancel" button

After that, you can't close NetBeans either by using Close button or File -> Exit menu option.
Comment 8 ecerichter 2013-05-17 14:30:39 UTC
Ok, I got it!

When I start my web project in debug mode, it also start another process for GWT debugging.

When this happens, the IDE will show a message about the running processes that will be closed.

See attached video for reference.
Comment 9 ecerichter 2013-05-17 14:38:57 UTC
Created attachment 134572 [details]
Video of the issue.

Even after closing all open processes, I can't close IDE.
Comment 10 Jan Lahoda 2013-05-17 15:03:33 UTC
Thanks Edson for testing! Simple step to reproduce:
-run a long-lasting J2SE Application. Something like this suffices:
    public static void main(String[] args) {
        while (true) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException ex) {
                Logger.getLogger(JavaApplication10a.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
-try to close the IDE, a dialog appears (correct), Cancel the dialog.
-stop the application
-try to close the IDE, its not going to work.

I still fail to see the proclaimed connection with java.source. The problem appears to be mostly in NbLifecycleManager, and as follows:
1. NbLifecycleManager.exit(int) sets the isExitOnEventQueue to true
2. NbLifecycleManager.exit(int) then runs, performs Mutex.EVENT.readAccess(action);, inside which the confirmation dialog is shown, and when it is cancelled, the logic NbLifeExit.run correctly stops the shutdown.
3. when control returns into NbLifecycleManager.exit(int), it runs finishExitState(cdl, true). But the invocation if this method never ends - it starts another event queue, and the whole IDE then continues running in this new event queue. The NbLifecycleManager.isExitOnEventQueue is still set to true (the finally in NbLifecycleManager.exit(int) is never called).
4. any further attempt to stop the IDE is end quickly in NbLifecycleManager.exit(int) because the NbLifecycleManager.isExitOnEvenQueue flag is set.

As the most likely culprit appears to be the logic in the NbLifecycleManager, I am reassigning to component that covers o.n.core, which according to .nbbugzillacomponents is "platform/-- other --".
Comment 11 ecerichter 2013-05-17 16:20:12 UTC
You are welcome.

I was trying to get a way easier to reproduce. You got it.

I think this bug has been there for a long time (6.x or even older), I just never attached the problem with the conditions that it happened.

Thanks to the effort of you all, we will get this fixed.

This bug probably hit 7.3.x as well, would be good to check the recently announced (to NetCAT team) 7.3.1.

Regards,

Edson
Comment 12 Jan Lahoda 2013-06-02 20:29:52 UTC
*** Bug 230623 has been marked as a duplicate of this bug. ***
Comment 13 ecerichter 2013-06-04 20:34:12 UTC
Still happen in 201306032300.
Comment 14 Ondrej Vrabec 2013-06-06 07:42:38 UTC

*** This bug has been marked as a duplicate of bug 230452 ***
Comment 15 ecerichter 2013-06-06 12:24:40 UTC
Can you explain why this bug that has a complete discussion of the problem and also the steps to reproduce and also test case program has been marked as duplicate of a later bug report that is incomplete, has no test case and no steps to reproduce?
I can see no logic behind it. IMHO, close the incomplete, and keep the one that already has the information you need to fix the bug.

Regards,

Edson
Comment 16 Ondrej Vrabec 2013-06-06 12:27:50 UTC
(In reply to comment #15)
bug #230452 is not INCOMPLETE but NEW. And it's more likely to be fixed than this one which is not assigned to the correct person.
Comment 17 ecerichter 2013-06-06 12:44:58 UTC
(In reply to comment #16)
> (In reply to comment #15)
> bug #230452 is not INCOMPLETE but NEW. And it's more likely to be fixed than
> this one which is not assigned to the correct person.

Is not marked as "incomplete" (but is incomplete in the concept: there is no steps to reproduce, no test case, nothing else).
And please, changing the assignment is so easy, that your argument still have no logic.

I've spent time to provide enough information for the fix. Just be sure to not start all over again. The fix is one step away if you follow this ticket.

Also, the number of tickets fixed in my account is a matter of proud for me. I don't pay a penny for Oracle to fix those bugs, my time is my contribution and the way I measure how I'm giving back.
Comment 18 ecerichter 2013-06-18 11:28:41 UTC
Ondrej Vrabec, you were so wrong in closing this ticket without looking into details.

So, look carefully.

I hate to waste my and your time, and believe me, I'm really mad with this discussion already.

I've been repeating everything in the other thread, and now I'll have to repeat AGAIN here.

Starting to post AGAIN video, thread dump and log.

Edson.
Comment 19 ecerichter 2013-06-18 11:31:13 UTC
Created attachment 135956 [details]
DEV 20130616: Log with the -J-Dorg.netbeans.core.NbLifecycleManager.level=FINE
Comment 20 ecerichter 2013-06-18 11:32:38 UTC
Created attachment 135957 [details]
DEV 201306162301 - Video showing the issue
Comment 21 ecerichter 2013-06-18 11:33:07 UTC
Created attachment 135958 [details]
DEV 20130616: Thread dump
Comment 22 ecerichter 2013-06-18 11:44:56 UTC
Added better summary now that the real issue is clarified.
Comment 23 Jaroslav Tulach 2013-06-18 12:05:47 UTC
The new video shows a running process (executed on Tomcat). Passing to EE guys as this has nothing to do with platform/module system.
Comment 24 ecerichter 2013-06-18 12:16:37 UTC
(In reply to comment #23)
> The new video shows a running process (executed on Tomcat). Passing to EE guys
> as this has nothing to do with platform/module system.

Yes, and I should add that the original behavior relate to any kind of process - not only Tomcat.

Now, after some patching, this happen with Tomcat (not with java desktop alike) - would this be related to Chrome plugin exchanging information with NetBeans?
Comment 25 Petr Jiricka 2013-06-21 21:26:32 UTC
I am not able to reproduce the symptoms shown in the latest video. I tried:
1. Create a blank Java web project (Ant-base) with Tomcat 7.0.x as the target server
2. Make sure that Chrome with NetBeans Integration is set as the default browser
3. Debug the project
4. Shut down the IDE

Works fine, the IDE stops Tomcat and then it exits. I am not getting the dialog alerting about running processes. I tried both Windows XP and Mac OS X 10.7.5.

A few questions:
- Does this happen only for GWT applications, or for any project?
- Does this also happen if you choose another browser (e.g. Firefox) in the browser switcher in the main toolbar?
- Does this happen only for Tomcat, or other servers as well?

Thanks.
Comment 26 ecerichter 2013-06-22 00:03:14 UTC
(In reply to comment #25)
> I am not able to reproduce the symptoms shown in the latest video. I tried:
> 1. Create a blank Java web project (Ant-base) with Tomcat 7.0.x as the target
> server
> 2. Make sure that Chrome with NetBeans Integration is set as the default
> browser
> 3. Debug the project
> 4. Shut down the IDE
> 
> Works fine, the IDE stops Tomcat and then it exits. I am not getting the dialog
> alerting about running processes. I tried both Windows XP and Mac OS X 10.7.5.
> 
> A few questions:
> - Does this happen only for GWT applications, or for any project?

It was for any projects. But since DEV201306192300 it is working normally: when closing NetBeans it closes Tomcat without error, even in debug model.
Regarding GWT

> - Does this also happen if you choose another browser (e.g. Firefox) in the
> browser switcher in the main toolbar?

Until DEV201306162300, the problem was present no matter browser I used. Seems that tomcat process was listed as blocking process for NB shutdown.

> - Does this happen only for Tomcat, or other servers as well?

Definitely Tomcat, I can't use Glassfish 4 (see issue 231584).

I think we can close this as fixed (probably by another ticket) or worksforme sice it is working normally in 201306192300.
Comment 27 Petr Jiricka 2013-06-22 05:12:26 UTC
-> FIXED.