RFR: JDK-8292351: tty should always live [v4]

Thomas Stuefe stuefe at openjdk.org
Sun Aug 21 07:23:47 UTC 2022


On Fri, 19 Aug 2022 01:18:27 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Change comment
>
> Hi Thomas,
> 
> I think for pre-init we would look at adding an env var (which would require a CSR request) when we actually have some logging we want to add. This PR could simply do the enabling for tty to be usable at that time ie set to stdout (as the default VM output destination).
> 
> Your suggestion for post-exit seems reasonable, though we may also have to consider the flag that requests VM output get logged to a file (which we probably can't do). I think it reasonable that error and warning output go to stdout/stderr in post-exit. If other more general logging needed to be added for post-exit then that would be evaluated at the time.
> 
> Thanks.

@dholmes-ora : I reformed the patch according to our compromise:
- pre-init output is swallowed, but we don't crash. We can add the envvar solution later if needed.
- post-exit output is taken over by a stream that attempts to mimic the defaultStream's behavior.
 
I did not find a VM flag to redirect defaultStream to a file. And we can still crash if concurrent threads attempt to use tty, but the window of opportunity is much smaller. I did not want to pull tty_lock though since I don't want to hold up VM shutdown in case of an error.

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

PR: https://git.openjdk.org/jdk/pull/9874


More information about the hotspot-dev mailing list