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(java): exception is logged when Java VM is shutting down #2305

Merged
merged 4 commits into from
Dec 4, 2020

Conversation

RomainMuller
Copy link
Contributor

Guards against the IllegalStateException that will be thrown upon
attempting to remove a shutdown hook during VM shut down. In such cases,
the removal is no longer possible nor necessary, so the exception can be
safely ignored.

Fixes #2303


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Guards against the `IllegalStateException` that will be thrown upon
attempting to remove a shutdown hook during VM shut down. In such cases,
the removal is no longer possible nor necessary, so the exception can be
safely ignored.

Fixes #2303
@RomainMuller RomainMuller added bug This issue is a bug. effort/small Small work item – less than a day of effort labels Dec 3, 2020
@RomainMuller RomainMuller requested a review from a team December 3, 2020 10:54
@RomainMuller RomainMuller self-assigned this Dec 3, 2020
Comment on lines +123 to +129

<!-- https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>\${javax-annotations.version}</version>
</dependency>
Copy link
Contributor Author

@RomainMuller RomainMuller Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This improves compat with "more recent" JDKs (where the "built-in" @javax.annotations.* was moved to a different package).

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Dec 3, 2020
@mergify
Copy link
Contributor

mergify bot commented Dec 4, 2020

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Dec 4, 2020
@mergify
Copy link
Contributor

mergify bot commented Dec 4, 2020

Merging (with squash)...

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-5lHf64IXfvmr
  • Commit ID: 34da271
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 8e1e7bd into main Dec 4, 2020
@mergify mergify bot deleted the rmuller/java-clean-up branch December 4, 2020 15:36
@mergify
Copy link
Contributor

mergify bot commented Dec 4, 2020

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception is logged when Java VM is shutting down
3 participants