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

Fix SpringApplicationShutdownHook throws ClassCastException #26981

Closed
wants to merge 1 commit into from
Closed

Conversation

vikeychen
Copy link
Contributor

Fixes #26953

I think the we can programmatically disabling log4j shutdown hook when initialize, since SpringApplicationShutdownHook will handle shutdown. I noticed in the previous version(before 2.5.1), spring shutdown hook is executed before log4j2 shutdown hook,so no exception throws.

Or we can try catch in shutdownhandler to ignore the exception, exception means log context has been removed, so created a one will throw excpetion .I perfer the try catch method, since the previous is not Configurable.

@pivotal-cla
Copy link

@vikeychen Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@vikeychen Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 20, 2021
@snicoll
Copy link
Member

snicoll commented Jun 22, 2021

@vikeychen thank you for the PR but catching ClassCastException is not an approach we're keen to take. We're exploring other options to fix this issue.

@snicoll snicoll closed this Jun 22, 2021
@snicoll snicoll added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 22, 2021
@vikeychen vikeychen deleted the 2.5.x branch June 23, 2021 03:23
@vikeychen vikeychen restored the 2.5.x branch June 23, 2021 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants