Skip to content

Detect platform threads started inside simulation context#28

Merged
ylecaillez merged 1 commit intopingidentity:mainfrom
ylecaillez:feature/thread-start-advice
Apr 10, 2026
Merged

Detect platform threads started inside simulation context#28
ylecaillez merged 1 commit intopingidentity:mainfrom
ylecaillez:feature/thread-start-advice

Conversation

@ylecaillez
Copy link
Copy Markdown
Collaborator

Add ThreadStartAdvice on Thread#start() that logs a lifecycle warning when a platform thread is started inside a simulation. Platform threads escape deterministic scheduling and are a source of non-determinism (e.g. Netty's GlobalEventExecutor spawning FastThreadLocalThread).

Pre-initialize VirtualThread in premain() to ensure the JDK's VirtualThread-unblocker platform thread is created before any simulation runs, avoiding a false positive from the new guard.

Extend it-thread to verify no platform thread starts leak into the simulation replay output.

Add ThreadStartAdvice on Thread#start() that logs a lifecycle warning
when a platform thread is started inside a simulation. Platform threads
escape deterministic scheduling and are a source of non-determinism
(e.g. Netty's GlobalEventExecutor spawning FastThreadLocalThread).

Pre-initialize VirtualThread in premain() to ensure the JDK's
VirtualThread-unblocker platform thread is created before any
simulation runs, avoiding a false positive from the new guard.

Extend it-thread to verify no platform thread starts leak into the
simulation replay output.
@ylecaillez ylecaillez merged commit 4148975 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