| Summary: | Eclipse waiting for termination of process tree instead of JVM | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Kent Tong <kent> |
| Component: | Debug | Assignee: | JDT-Debug-Inbox <jdt-debug-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | darin.eclipse, remy.suen, sarika.sinha |
| Version: | 3.3 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
This seems to be related to the launching of Java code and has nothing to do with the Eclipse UI. You also may want to give 3.6 a try. http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/index.php In addition, it is working fine in Linux. The problem only happens in Windows. The problem does exist on Windows. If I "exit" the lanuched command window then the process in Eclipse shows terminated. This may just be an OS limitation, as Eclipse is simply waiting for the java.lang.Process to exit. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. We are not planning to fix it. |
Build Identifier: I20070621-1340 Please run the Java program in Eclipse. Even though the JVM is terminated (as shown in the process list in the OS) and the shutdown hook is called, the red button will still be on in the Console window, meaning that Eclipse thinks that something is still running. This happens only if the Java program launches another process. If I end that child process, Eclipse will note the termination. So, somehow Eclipse is waiting for the whole process tree to terminate, not the JVM. public class Launcher { boolean isDone = false; public static void main(String[] args) throws InterruptedException { new Launcher().run(); } private void run() throws InterruptedException { final Runtime runtime = Runtime.getRuntime(); Thread thread = new Thread(new Runnable() { @Override public void run() { try { Process process = runtime.exec("cmd.exe /c start"); process.getErrorStream().close(); process.getOutputStream().close(); System.out.println("Done!"); isDone = true; } catch (Exception e) { throw new RuntimeException(e); } } }); thread.setDaemon(true); thread.start(); runtime.addShutdownHook(new Thread() { @Override public void run() { System.out.println("Shutdown hook called."); } }); while (!isDone) { Thread.sleep(1000); } runtime.exit(0); } } Reproducible: Always Steps to Reproduce: 1. Run the above program in Eclipse 2. Note the red button is on, even though the shutdown hook is called 3. End the child process (the command prompt), note that the red button is now off.