[crac] Integrated: Ensure all notifications finish even if only daemon threads remain

Anton Kozlov akozlov at openjdk.org
Thu May 25 12:44:28 UTC 2023


On Thu, 4 May 2023 13:34:47 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

> If as a result of beforeCheckpoint() no more non-daemon threads remain, it's possible that VM exits prematurely, before one of afterRestore() get a chance to create another non-daemon thread that will keep VM alive. Triggering checkpoint via jcmd (so checkpointRestore() method is executed on daemon attach-listener thread), increases probability to step in the problem.
> 
> The change ensures all notifications are done while there is at least one non-daemon thread. The notification methods are still called from the original thread.

This pull request has now been integrated.

Changeset: 68de4bed
Author:    Anton Kozlov <akozlov at openjdk.org>
URL:       https://git.openjdk.org/crac/commit/68de4bed4e3984929ce3dfad29565d24d04b0790
Stats:     203 lines in 4 files changed: 188 ins; 7 del; 8 mod

Ensure all notifications finish even if only daemon threads remain

Co-authored-by: Radim Vansa <rvansa at azul.com>

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

PR: https://git.openjdk.org/crac/pull/62


More information about the crac-dev mailing list