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

Exception is logged when Java VM is shutting down #2303

Closed
majasb opened this issue Nov 25, 2020 · 12 comments · Fixed by #2305
Closed

Exception is logged when Java VM is shutting down #2303

majasb opened this issue Nov 25, 2020 · 12 comments · Fixed by #2305
Assignees

Comments

@majasb
Copy link

majasb commented Nov 25, 2020

Exception is logged when Java VM is shutting down.

Reproduction Steps

Kotlin unit test synthesizing an empty app:

import software.amazon.awscdk.core.App
import kotlin.test.Test
import kotlin.test.assertEquals

class AssemblyTest {
    @Test fun testSynthesize() {
        val app = App()
        val cloudAssembly = app.synth()
        assertEquals(0, cloudAssembly.stacks.size)
    }
}

What did you expect to happen?

No stacktrace logged.

What actually happened?

Exception in thread "Terminate jsii client" java.lang.IllegalStateException: Shutdown in progress
	at java.base/java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82)
	at java.base/java.lang.Runtime.removeShutdownHook(Runtime.java:241)
	at software.amazon.jsii.JsiiRuntime.terminate(JsiiRuntime.java:224)
at java.base/java.lang.Thread.run(Thread.java:835)

Environment

  • CDK CLI Version : 1.75.0 (build 7708242)
  • Framework Version: 1.75.0
  • Node.js Version: v12.6.0
  • OS : macOS 11.0.1 (20B29)
  • Language (Version): Java (12.0.1)

Other


This is 🐛 Bug Report

@SomayaB SomayaB changed the title java.lang.IllegalStateException: Shutdown in progress Exception is logged when Java VM is shutting down Nov 25, 2020
@john-tipper
Copy link

I am seeing the same issue with CDK CLI 1.71.0 (build 953bc25)

@maciejwalkowiak
Copy link

I am seeing the same issue with downgrading even to CLI 1.40.0

@pkatul
Copy link

pkatul commented Nov 28, 2020

I also face the same issue.
CLI version - aws-cli/1.16.292

@michaelbrewer
Copy link

michaelbrewer commented Nov 28, 2020

Same issue her

CLI version - 1.75.0 (build 7708242)
Java version - openjdk 11.0.8 2020-07-14 LTS
Operating system - macOS 10.15.7 (19H15)
Node version - v12.20.0

@timmattison
Copy link

Same here, but my stacks still launch successfully

AWS CLI version - aws-cli/2.0.62 Python/3.7.4 Darwin/18.7.0 exe/x86_64
CDK version - 1.75.0

@kdavisk6
Copy link

kdavisk6 commented Dec 1, 2020

Same issue, and same result as @timmattison. Also, it appears intermittently. The Stack does get built and deployed successfully.

@michaelbrewer
Copy link

Very strange issue

@levischuckeats
Copy link

I started receiving this today, it appears to run when maven runs tests.

@RomainMuller
Copy link
Contributor

RomainMuller commented Dec 3, 2020

Hey! Thanks for reporting! It appears the de-registering method cannot be called during VM shutdown, causing this stack trace to be logged. It should not affect your application's ability to run correctly and can be ignored until we release an updated version of the runtime which no longer attempts the illegal operation.

@RomainMuller RomainMuller transferred this issue from aws/aws-cdk Dec 3, 2020
@RomainMuller
Copy link
Contributor

@all-contributors add @majasb for bug

@allcontributors
Copy link
Contributor

@RomainMuller

I've put up a pull request to add @majasb! 🎉

RomainMuller added a commit that referenced this issue Dec 3, 2020
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
mergify bot pushed a commit that referenced this issue Dec 3, 2020
Adds @majasb as a contributor for bug.

This was requested by RomainMuller [in this comment](#2303 (comment))
@mergify mergify bot closed this as completed in #2305 Dec 4, 2020
mergify bot pushed a commit that referenced this issue Dec 4, 2020
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].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2020

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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

Successfully merging a pull request may close this issue.

9 participants