It looks like the eventId and parentId of the JFR events generated by 'FlightRecorderApplicationStartup' do not match. Spring Wrong parentId tracking in FlightRecorderApplicationStartup Spring Wrong parentId tracking in FlightRecorderApplicationStartup

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

Comment From: bclozel

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.

Comment From: youngledo

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:

Spring Wrong parentId tracking in FlightRecorderApplicationStartup

Comment From: youngledo

An issue related to Spring Boot, migrating to: https://github.com/spring-projects/spring-boot/issues/43615

Comment From: youngledo

Spring Wrong parentId tracking in FlightRecorderApplicationStartup 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: Spring Wrong parentId tracking in FlightRecorderApplicationStartup

After making this change, everything is normal: Spring Wrong parentId tracking in FlightRecorderApplicationStartup Spring Wrong parentId tracking in FlightRecorderApplicationStartup

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

Comment From: bclozel

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