RFR: 8303198: System and Runtime.exit() resilience to logging errors
Jaikiran Pai
jpai at openjdk.org
Wed Mar 1 15:19:41 UTC 2023
On Wed, 1 Mar 2023 15:13:06 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/Shutdown.java line 186:
>>
>>> 184: try {
>>> 185: // Exceptions from the Logger are printed but do not prevent exit
>>> 186: System.err.println("Runtime.exit() logging failed: " + throwable.getMessage());
>>
>> Hello Roger, do you think including the exit code in this System.err.println message would be useful too? That would then mean that if the Logger failed for whatever reason, this fallback message would at least include the exit code to provide some hints on what might have triggered the exit.
>
> Including the status is simple enough, but has little/nothing to do with why the logging call failed.
Agreed - the exit code in the System.err.println fallback would merely be a last resort to provide some possible hint on what code might have triggered an exit.
-------------
PR: https://git.openjdk.org/jdk/pull/12770
More information about the core-libs-dev
mailing list