[crac] RFR: Reseed secure random on checkpoint restore [v4]

Alexey Bakhtin abakhtin at openjdk.java.net
Fri Jan 28 12:59:35 UTC 2022

On Thu, 27 Jan 2022 08:51:34 GMT, Alexey Bakhtin <abakhtin at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/crac/CheckpointException.java line 32:
>>> 30:  * Suppresses exceptions thrown during checkpoint notification.
>>> 31:  */
>>> 32: public class CheckpointException extends RuntimeException {
>> This is a severe change and it makes CheckpointException unchecked. We want users to provide explicit handling of CheckpointException, please revert.
> This is an internal jdk.crac Exception that is not visible to users. It is used for JVM resources only and handled explicitly in jdk.crac.Core. This exception will be thrown from existing JDK classes, so it was changed to unchecked to make it possible to throw exception without changing signature of the existing public API (e.g. https://github.com/openjdk/crac/blob/3ade9580452ab2db193e9c2c1b458a2ff17a8597/src/java.base/share/classes/sun/security/provider/SecureRandom.java#L296 or https://github.com/openjdk/crac/blob/dd46160142a3ec490a400f56738d0251d128494a/src/java.base/unix/classes/sun/security/provider/NativePRNG.java#L556 or https://github.com/openjdk/crac/blob/dd46160142a3ec490a400f56738d0251d128494a/src/java.base/unix/classes/sun/security/provider/NativePRNG.java#L490)
> Also, it was approved already in the https://github.com/openjdk/crac/pull/9

After additional discussions, it was decided to revert these changes and use checked CheckpointException.
JDKResources can throw another RuntimeExceptions like IllegalStateException if required to indicate a failure during checkpoint/restore. All exceptions are processed in the AbstractContextImpl.beforeCheckpoint(), restore resources and throw ChecpointException to the user with the real cause.


PR: https://git.openjdk.java.net/crac/pull/7

More information about the crac-dev mailing list