RFR 8067748: (process) Child is terminated when parent's console is closed [win]

Ivan Gerasimov ivan.gerasimov at oracle.com
Thu Jan 22 14:37:08 UTC 2015


It was reported that the fix for JDK-8023130 ((process) 
ProcessBuilder#inheritIO does not work on Windows) had caused a regression.

It manifests itself in the following situation:
1) A console java application starts a child process.
2) The parent then exits without waiting for the child to complete, the 
child is running.
3) The console window, the parent app was started from, is closed.
4) The child process is unexpectedly terminated.

The solution is to tighten the cases in which we drop CREATE_NO_WINDOW 
flag: it is dropped only any IO stream of the parent is going to be 
inherited by the child.
Only in that later case keeping the child attached to console makes sense.

The fix was tested manually: the inheritIO behavior is preserved, the 
regression is gone.

Unfortunately, no regression test is attached.
It's hard to create a test, which involves closing the console window 
and manipulating the detached child application.

Would you please help review the fix?

BUGURL: https://bugs.openjdk.java.net/browse/JDK-8067748
WEBREV: http://cr.openjdk.java.net/~igerasim/8067748/0/webrev/

Sincerely yours,

More information about the core-libs-dev mailing list