spring-projects/spring-framework

Wrong parentId tracking in FlightRecorderApplicationStartup

Closed this issue · 5 comments

It looks like the eventId and parentId of the JFR events generated by 'FlightRecorderApplicationStartup' do not match.
image
image

I don't know if I did something wrong?

Here is my sample code and JVM parameters:

@SpringBootApplication
public class StartApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(StartApplication.class);
        springApplication.setApplicationStartup(new FlightRecorderApplicationStartup());
        springApplication.run(args);
    }
}
-XX:StartFlightRecording:filename=/data/app.jfr,duration=30s -XX:FlightRecorderOptions=stackdepth=192

Additional

Spring Boot Version: 2.5.15

Thanks for the report but Spring Boot 2.5.15 is out of open source support. We can reopen this issue if you can reproduce the problem on a supported version.

Thanks for the report but Spring Boot 2.5.15 is out of open source support. We can reopen this issue if you can reproduce the problem on a supported version.

I tried to use the '3.4.1 'version, and it seems to be the same:

image

An issue related to Spring Boot, migrating to: spring-projects/spring-boot#43615

image
After debugging and analysis, for the "spring.context.beans.post-process" example, its parent ID should be "spring.context.refresh", but due to the incorrect execution order of "this.currentSteps.getFirst()" (it should be before "this.currentSteps.offerFirst(sequenceId)"), everything else went wrong:
image

After making this change, everything is normal:
image
image

This is the jfr file after my test:
recording.zip

Sorry for the delay @youngledo I'll have a look this week.