[crac] RFR: JDKResource priorities

Anton Kozlov akozlov at openjdk.java.net
Wed Dec 22 10:15:44 UTC 2021


On Mon, 20 Dec 2021 15:39:03 GMT, Alexey Bakhtin <abakhtin at openjdk.org> wrote:

> Added priority enumeration for the JDK resources
> It will allow better handling the order of checkpoint notifications for dependent resources

Marked as reviewed by akozlov (Lead).

src/java.base/share/classes/jdk/internal/crac/JDKResource.java line 36:

> 34:      * Most resources should use NORMAL.
> 35:      * Other priorities define sequence of
> 36:      * checkpoint notification for dependent resources

It's worth adding explicitly how the order in the enum and priorities are related. E.g. priorities are specified in the decreasing order. If a priority A is specified before a priority B, a resource with A will be handled sooner.

"Order" would be a better term for this in the first place originally, my fault.

src/java.base/share/classes/jdk/internal/crac/JDKResource.java line 43:

> 41:          * sun.nio.ch.EPollSelectorImpl resource
> 42:          */
> 43:         EPOLLSELECTOR,

This uncovers the future mess we'll have with manually setting the order, similar to the mutex order in the Hotspot. However, I like this central place to control them. This approach is by no means worse than the existing code but highlights a point of growth.

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

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


More information about the crac-dev mailing list