[jdk8u-dev] RFR: 8287132: Retire Runtime.runFinalizersOnExit so that it always throws UOE
David Holmes
david.holmes at oracle.com
Fri Jul 29 23:06:23 UTC 2022
On 30/07/2022 5:07 am, Thorsten Glaser wrote:
> On Fri, 29 Jul 2022, David Holmes wrote:
>
>> On 29/07/2022 11:22 am, Bernd Eckenfels wrote:
>>> Agreed, In addition to that, I also think (as already mentioned, sorry
>>> ,) the runFinalizerOnExit() should be a NOP or allow a system property to
>>> turn it into a nop.
>>
>> This change has already been proposed and accepted by the JCP as part of SE 8
>> Maintenance Release 4:
>
> And that’s fine for the reference implementation.
>
> However, *this*, here, is about the real-world real-existing OpenJDK
> which real applications use, and which is in security/bugfixes only
> mode and therefore needs to not break existing applications. It’s not
> only perfectly fine but even, to some point, expected that different
> decisions are taken, for compatibility reasons mostly.
It is my understanding that compliance with the Java SE 8 platform
specification, including MR4, is a requirement for the OpenJDK as well.
With regards to turning the method into a nop instead of throwing UOE,
that was considered (of course) and rejected as too risky. Any code (if
it exists) that actually relies on finalizers running at exit could be
broken in non-obvious ways if we simply silently stopped running those
finalizers. It was considered far better to fail-fast(er) at the time
RFOE was called.
David
-----
> bye,
> //mirabilos
More information about the jdk8u-dev
mailing list