[crac] RFR: Fix ordering of invocation on Resources

Radim Vansa duke at openjdk.org
Mon Apr 24 13:36:15 UTC 2023


On Mon, 24 Apr 2023 10:50:54 GMT, Radim Vansa <duke at openjdk.org> wrote:

>> The CheckpointException is a CRaC-specific, deliberately thrown exception to communicate the problem with the state to the requester of the checkpoint. The exception may suggest rewriting the code, or another attempt. We don't care a lot about the preceise meaning, we just need to deliver the exception. Although lesser number of exceptions is better of course.
>
> I realized that you actually asked for a different behaviour than what I thought initially, something like the `ConcurrentModificationException` while iterating a collection. That is not that bad, and we can add debug option to track where this happened.

I figured out there is another problem with allowing the registration and failing afterwards: let's assume that you have two children contexts, C1 and C2. C1.beforeCheckpoint succeeds, and during C2.beforeCheckpoint you try to register something on C1. You suggest to allow this, but C1 won't be invoked and we cannot find that there's a new resource that should have failed the checkpoint - so it's kind of silently failing. The best you could do is to invoke the beforeCheckpoint on the resource when you find C1 to be done, but this is not what we discussed before.

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

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


More information about the crac-dev mailing list