Skip to content

Fix non-determinism from platform thread shutdown hooks#27

Merged
ylecaillez merged 1 commit intopingidentity:mainfrom
ylecaillez:fix/shutdown-hook-guard
Apr 10, 2026
Merged

Fix non-determinism from platform thread shutdown hooks#27
ylecaillez merged 1 commit intopingidentity:mainfrom
ylecaillez:fix/shutdown-hook-guard

Conversation

@ylecaillez
Copy link
Copy Markdown
Collaborator

Node.addShutdownHook() now skips hooks backed by platform threads (e.g. JUL's LogManager$Cleaner) with a logLifecycle warning, since platform threads cannot run deterministically inside the simulation.

New it-thread integration test forces LogManager initialization inside the simulation (triggering LogManager$Cleaner hook registration), verifies determinism via 50% replay probability, and asserts the guard fires by replaying a plan and checking for the lifecycle message.

Node.addShutdownHook() now skips hooks backed by platform threads
(e.g. JUL's LogManager$Cleaner) with a logLifecycle warning, since
platform threads cannot run deterministically inside the simulation.

New it-thread integration test forces LogManager initialization inside
the simulation (triggering LogManager$Cleaner hook registration),
verifies determinism via 50% replay probability, and asserts the guard
fires by replaying a plan and checking for the lifecycle message.
@ylecaillez ylecaillez merged commit 90de38c into pingidentity:main Apr 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant