Skip to content

Commit cf66236

Browse files
committed
Fix Wrong parentId tracking in JFR application startup
This commit fixes the tracking of the main event parentId for the Java Flight Recorder implementation variant. Fixes gh-34254
1 parent e1b06cc commit cf66236

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-core/src/main/java/org/springframework/core/metrics/jfr/FlightRecorderApplicationStartup.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,10 +51,11 @@ public FlightRecorderApplicationStartup() {
5151

5252
@Override
5353
public StartupStep start(String name) {
54+
Long parentId = this.currentSteps.getFirst();
5455
long sequenceId = this.currentSequenceId.incrementAndGet();
5556
this.currentSteps.offerFirst(sequenceId);
5657
return new FlightRecorderStartupStep(sequenceId, name,
57-
this.currentSteps.getFirst(), committedStep -> this.currentSteps.removeFirstOccurrence(sequenceId));
58+
parentId, committedStep -> this.currentSteps.removeFirstOccurrence(sequenceId));
5859
}
5960

6061
}

0 commit comments

Comments
 (0)