[crac] RFR: Fix ordering of invocation on Resources [v8]

Anton Kozlov akozlov at openjdk.org
Tue May 9 18:24:54 UTC 2023


On Tue, 9 May 2023 16:01:30 GMT, Radim Vansa <duke at openjdk.org> wrote:

>> * keeps the original handling of exceptions: afterRestore is called even if beforeCheckpoint throws
>> * allows to register a resource in a context that did not start beforeCheckpoint invocations yet
>> * registering resource in previous/running context fails the checkpoint but does not trigger exception immediately
>>    * instead this will be one of the recorded exceptions and the resource has a chance to fire next time
>> * allowed registration of resources can be invoked from other thread without deadlock; illegal registration can deadlock, though
>
> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert API change, force blocking registration

src/java.base/share/classes/jdk/crac/Resource.java line 65:

> 63:      * resource throwing an exception when {@link #beforeCheckpoint(Context)
> 64:      * beforeCheckpoint}.
> 65:      * Therefore, the resource should not have assumptions about it state; it

Resource can be sure the beforeCheckpoint was called, and object is exactly in the state at which the beforeCheckpoint has leaved it.

src/java.base/share/classes/jdk/crac/impl/OrderedContext.java line 76:

> 74:     @Override
> 75:     public void afterRestore(Context<? extends Resource> context) throws RestoreException {
> 76:         // Note: a resource might attempt to

Comment truncated?..

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

PR Review Comment: https://git.openjdk.org/crac/pull/60#discussion_r1188970172
PR Review Comment: https://git.openjdk.org/crac/pull/60#discussion_r1188980196


More information about the crac-dev mailing list