RFR: 8262157: LingeredApp.startAppExactJvmOpts does not print app output when launching fails

Yumin Qi minqi at openjdk.java.net
Tue Feb 23 04:11:39 UTC 2021


On Tue, 23 Feb 2021 03:43:41 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> It seems error prone to have to call finishApp() manually in order to see the error log. Since LingeredApp.startApp calls finishApp() on exceptions, shouldn't startAppExactJvmOpts do the same thing?
>
> Although you have a point, you've also pointed out another problem with this fix.  I think users of `startApp()` are already going to see the output twice because of the `finishApp()` call present there. By adding yet another `finishApp()` call to `startAppExactJvmOpts()`, now they will see it 3 times.
> 
> If you want to "move" the `finishApp()` call from `startApp()` to `startAppExactJvmOpts()`, then at least that will maintain the status quo with existing `startApp()` users, but we still have an issue with the output appearing twice, even before this change, and with this change it is now more common as `startAppExactJvmOpts()` will also start seeing it.
> 
> Maybe `finishApp()` should maintain an `alreadyCalled` flag so it does nothing on subsequent calls.

@plummercj @iklam Thanks for review. I will add a flag for finishApp so we will not call it more than once.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2679


More information about the hotspot-runtime-dev mailing list