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

Radim Vansa duke at openjdk.org
Tue May 2 07:27:48 UTC 2023


On Fri, 28 Apr 2023 13:14:20 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Radim Vansa has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - More fine-grained synchronization
>>  - Rework context ordering (round 2)
>>    
>>    * call afterRestore even if beforeCheckpoint throws
>>    * registering resource in previous/running context does not trigger exception immediatelly
>>    ** instead this will be one of the recorded exceptions and the resource has a chance to fire next time
>>    * we don't guarantee threads not deadlocking when trying to register a resource, though
>
> src/java.base/share/classes/jdk/crac/Core.java line 104:
> 
>> 102:      * Order of invoking {@link Resource#afterRestore(Context)} is the reverse
>> 103:      * of the order of {@link Resource#beforeCheckpoint(Context) checkpoint notification},
>> 104:      * hence the same as the order of {@link Context#register(Resource) registration}.
> 
> How about moving the Global Context description from the package level here (removing there). In javax.crac it should be fine to link to here IMO.

Okay, I can remove the description in package. As for `javax.crac` - I thought that this should be really a mirror of `jdk.crac`, why the distinction?

Another way might be to make OrderedContext a marker interface (move the implementation to OrderedContextImpl) and put the description there, using this interface for `getGlobalContext()`.

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

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


More information about the crac-dev mailing list