-
Notifications
You must be signed in to change notification settings - Fork 41.2k
StartupStep are closed twice in SpringApplicationRunListeners #22776
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
Comments
Thanks @mdeinum ! |
Although this works, doesn't this break the call from |
Prior to this commit the StartupStep.end method was being called from the default step action. However when overriding the default step action this might lead to the StartupStep.end method not being called. As in the case of a failure, as that enriches the information being written. This commit also introduces a test for the failure case showing that there is a missed call to end with the initial solution. See: spring-projectsgh-22776
Prior to this commit the StartupStep.end method was being called from the default step action. However when overriding the default step action this might lead to the StartupStep.end method not being called. As in the case of a failure, as that enriches the information being written. This commit also introduces a test for the failure case showing that there is a missed call to end with the initial solution. See: spring-projectsgh-22776
Prior to this commit the StartupStep.end method was being called from the default step action. However when overriding the default step action this might lead to the StartupStep.end method not being called. As in the case of a failure, as that enriches the information being written. This commit also introduces a test for the failure case showing that there is a missed call to end with the initial solution. See: spring-projectsgh-22776
Prior to this commit the StartupStep.end method was being called from the default step action. However when overriding the default step action this might lead to the StartupStep.end method not being called. As in the case of a failure, as that enriches the information being written. This commit also introduces a test for the failure case showing that there is a missed call to end with the initial solution. See: spring-projectsgh-22776
Prior to this commit the StartupStep.end method was being called from the default step action. However when overriding the default step action this might lead to the StartupStep.end method not being called. As in the case of a failure, as that enriches the information being written. This commit also introduces a test for the failure case showing that there is a missed call to end with the initial solution. See: spring-projectsgh-22776
With the introduction of #22600 I was eager to test this with Flight Recorder based events. For this purpose, I cloned the Petclinic, updated it to Spring Boot 2.4.0-SNAPSHOT and confined it to run using the
FlightRecorderApplicationStartup
. However, when doing so it results in an exception during startup.The events that are logged are
spring.boot.application.starting
,sequenceId
= 0spring.boot.application.starting
(?),sequenceId
= 0spring.boot.application.environment-prepared
,sequenceId
= 1spring.boot.application.failed
,sequenceId
= 2 -> which leads to the error due to thecurrentSteps
Deque
is empty.EDIT (1): The second
spring.boot.application.starting
event appears to be the result of includingspring-boot-devtools
as a dependency. Which I thought might be the culprit, however even without Devtools the applications breaks.To reproduce checkout petclinic, upgrade Spring Boot and use the following
PetClinicApplication
classThe application starts successfully when commenting the
.applicationStartup(new FlightRecorderApplicationStartup())
line.Parameters used to start the application with JFR metrics
-XX:StartFlightRecording:filename=recording.jfr,duration=10s
After some debugging it appears that the error is this the
doWithListeners
method in theSpringApplicationRunListeners
class.EDIT (2)
The lambda passed into
stepAction
results in theStartupStep.end
method being invoked twice, leading to exhausting theDeque
.Relates to: #22600
The text was updated successfully, but these errors were encountered: