Skip to content

8365407: Race condition in MethodTrainingData::verify() #26866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

veresov
Copy link
Contributor

@veresov veresov commented Aug 20, 2025

This change fixes multiple issue with training data verification. While the current state of things in the mainline will not cause any issues (because of the absence of the call to TD::verify() during the shutdown) it does problems in the leyden repo. This change strengthens verification in the mainline (by adding the shutdown verify call), and fixes the problems that prevent it from working reliably.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8365407: Race condition in MethodTrainingData::verify() (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26866/head:pull/26866
$ git checkout pull/26866

Update a local copy of the PR:
$ git checkout pull/26866
$ git pull https://git.openjdk.org/jdk.git pull/26866/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26866

View PR using the GUI difftool:
$ git pr show -t 26866

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26866.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 20, 2025

👋 Welcome back iveresov! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 20, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Aug 20, 2025

@veresov The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot [email protected] rfr Pull request is ready for review labels Aug 20, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 20, 2025

@veresov
Copy link
Contributor Author

veresov commented Aug 20, 2025

/label add hotspot-compiler

@openjdk
Copy link

openjdk bot commented Aug 20, 2025

@veresov
The hotspot-compiler label was successfully added.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few drive-by comments as I'm not familiar with this "training" stuff.

while (!CompileBroker::is_compilation_disabled_forever()) {
InstanceKlass* ik = _training_replay_queue.pop(TrainingReplayQueue_lock, THREAD);
void CompilationPolicy::replay_training_at_init_loop(JavaThread* current) {
while (!CompileBroker::is_compilation_disabled_forever() || AOTVerifyTrainingData) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it loop forever with + AOTVerifyTrainingData ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it runs in a dedicated thread. It doesn't need to terminate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants