-
Notifications
You must be signed in to change notification settings - Fork 4k
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(cli): cdk deploy
hangs when stack deployment fails
#6433
Conversation
Previously, when a stack would fail deployment we were using process.exit() which exited as quickly as possible even if async operations were pending. We rectified that by setting process.exitCode = 1 to allow all output to be flushed before a graceful exit. However, since we were not handling deployment errors, the Stack Activity Monitor was still polling every 5 seconds as the monitor is never explicitly halted. With this change, when a stack deployment fails, we halt the monitor before throwing the error. This ensures that there are no open handles when we call process.exitCode = 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pending:
- Write integration test
plz add an integ test |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@eladb @rix0rrr added the integ test. Notice that the test isn't really failing, it will just hang if we introduce the bug again. I imagine we have timeout configured on the build right? Are we good with this in the meantime? I thought about using the |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
Previously, when a stack would fail deployment we were using process.exit() which exited as quickly as possible, even if async operations were pending.
We rectified that by setting process.exitCode = 1 to allow all output to be flushed before a graceful exit. However, since we were not handling deployment errors, the Stack Activity Monitor was still polling every 5 seconds as the monitor is never explicitly halted.
With this change, when a stack deployment fails, we halt the monitor before throwing the error. This ensures that there are no open handles when we call process.exitCode = 1
Root caused by installing wtfnode as a dev dependency and calling
wtf.dump()
at the exit point. The only outstanding handle was the polling that the Stack Activity Monitor performs every 5 seconds.Fixes #6403
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license