Skip to content

Set name for shutdown hook Thread #23670

@turbanoff

Description

@turbanoff

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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions