RFR: 8315004: Runtime.halt() debug logging
Quan Anh Mai
qamai at openjdk.org
Tue Oct 31 01:34:33 UTC 2023
On Tue, 31 Oct 2023 00:14:39 GMT, Masanori Yano <myano at openjdk.org> wrote:
>>> @AlanBateman Sorry for missing your comment on JBS. I can't find any discussion of the need for logs in Runtime.halt in JDK-8301627, so I'm not sure if it was intentional that no logging output was added to Runtime.halt.
>>> However, if Runtime.halt is overlooked without discussion, I think it should be added after considering the need.
>>> I think it's the same problem as Runtime.exit when it comes to executing arbitrary code.
>>> Are there any issues specific to Runtime.halt?
>>
>> The purpose of the halt method is to terminate immediately, it doesn't initiate the shutdown sequence. My recollection of the System.exit logging is that it was deliberate to not change the halt method. Changing halt to log means it would not terminate immediately. Also I think there were concerns with logging libraries that needed the shutdown hook to execute in order to fush/close logs. @RogerRiggs or @stuart-marks may be able to say more about this.
>
> @AlanBateman @RogerRiggs Could you comment on the above?
@masyano Probably in that case a diagnostic flag that defaulted to `false` may be more reasonable.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15426#issuecomment-1786294006
More information about the core-libs-dev
mailing list