Skip to content
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

Set name for shutdown hook Thread #23670

Closed
turbanoff opened this issue Sep 19, 2019 · 1 comment
Closed

Set name for shutdown hook Thread #23670

turbanoff opened this issue Sep 19, 2019 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@turbanoff
Copy link

turbanoff commented Sep 19, 2019

Method org.springframework.context.support.AbstractApplicationContext#registerShutdownHook register shutdown hook Thread to close context on JVM shutdown,
https://github.com/spring-projects/spring-framework/blob/master/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java#L941
But it doesn't set name for this Thread. It's common good practice to set proper names for java thread to make diagnostic and troubleshooting easier.
I propose to set some name for shutdown hook Threads. For example SpringContextShutdownHook-N instead of current Thread-N.

This is how such threads look in Eclipse MAT
image

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 19, 2019
@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 19, 2019
@sbrannen sbrannen added this to the 5.2 GA milestone Sep 19, 2019
@sbrannen sbrannen self-assigned this Sep 20, 2019
@sbrannen
Copy link
Member

Great idea, @turbanoff.

I've implemented that in 3603e0c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants