[crac] RFR: Selectable Global Context implementation

Anton Kozlov akozlov at openjdk.org
Thu Jun 29 12:34:27 UTC 2023


On Thu, 29 Jun 2023 06:51:05 GMT, Radim Vansa <rvansa at openjdk.org> wrote:

>> I considered register() interface. The waitForReferenceProcessing is an internal JDK interface. The reference processing itself does not require the special managment on checkpoint, but it's checkpoint requirement as a procedure that no reference processing is in progress at some certain point.
>> 
>> The class is a boilerplate code to call two methods, it is not shared and unlikely will, so a separate file is not justified.
>
> If it's a requirement (and not an optimization), how come it's not prevented from running? (the blocking was there for a time before you reverted that, wasn't it?)

This piece of code is reletated to this part of the description

> To make properties available, it was required to delay Reference resource registration. Otherwise, the GlobalContext implementation decision had to be done too early, in the Reference initialization during JDK bootstrapping, before Properties are available.

Without this code, the ReferenceResource was registered during Reference initialization. At that point, Properties were not initalized yet, so any attempt to call System.getProperty() threw NPE (regardless parameters).

I.e. if we have the default context implementation configuration via properties, we need to delay ReferenceResource registration.

>> Since there is no way to employ BlockingContext other than as the global context implementation, I prefer to make it selectable.
>
> OK, so in the future you intend to just change the default and provide non-blocking implementation as the workaround for cases where the registration is not synchronized properly? In that case it makes sense...

Exactly. At some point we'll set on a single, the best implementation. But after the experience, I think we'll need the configuration for a while even after we change the default.

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

PR Review Comment: https://git.openjdk.org/crac/pull/87#discussion_r1246553267
PR Review Comment: https://git.openjdk.org/crac/pull/87#discussion_r1246555823


More information about the crac-dev mailing list