Skip to content

Call StartupStep.end in finally block #25572

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

Conversation

mdeinum
Copy link
Contributor

@mdeinum mdeinum commented Aug 10, 2020

Prior to this commit it was possible that a StartupStep was
started but never ended. This was the case when an exception
occured during bean initializing. To always call the method
regardless of the outcome, the call to StartupStep.end has
been moved to a finally block.

When an exception occurs the StartupStep is also enriched with
the exception class and message for diagnostic purposes.

Related: spring-projects/spring-boot#22776

Prior to this commit it was possible that a StartupStep was
started but never ended. This was the case when an exception
occured during bean initializing. To always call the method
regardless of the outcome, the call to StartupStep.end has
been moved to a finally block.

When an exception occurs the StartupStep is also enriched with
the exception class and message for diagnostic purposes.

Related: spring-projectsgh-22776
@mdeinum
Copy link
Contributor Author

mdeinum commented Aug 10, 2020

Maybe more events need to be in a try/finally approach due to possible errors being generated? I didn't investigate all other events (as this was the one that was missing).

@bclozel bclozel self-assigned this Aug 24, 2020
@bclozel bclozel added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 24, 2020
@bclozel bclozel added this to the 5.3 RC1 milestone Aug 24, 2020
@bclozel bclozel closed this in 74a0147 Aug 24, 2020
@bclozel
Copy link
Member

bclozel commented Aug 24, 2020

Thanks @mdeinum , I totally missed that one; I'll take another look at other events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants