-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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): release outdir lock when synth fails #30874
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
This makes good sense. Let me know when it's ready for review, and we can run it through the pipeline. |
@scanlonp Thanks for checking in. I've marked it ready now. I'll keep an eye out for feedback. TY |
Can look at our testing for I can also pull this down and test it out; I assume this fixed |
Sounds good. I wasn't sure about that part and had been asking around. 😂
Yep. Works great for me! |
@Mergifyio update |
❌ Mergify doesn't have permission to updateFor security reasons, Mergify can't update this pull request. Try updating locally. |
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
Worked clean in the pipeline. Adding labels. |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
@scanlonp Hey. Do I need to do anything with the code to move this PR forward? I saw that the CodeQL action failed, but its failure appears to be an out-of-space condition not necessarily related to this change. |
Hey @misterjoshua, I think the code is in a good spot. I want to test this out myself just to double check (even though I 100% believe your local testing results!). I'll make it a goal to have it in by the next release. Also I believe the CodeQL is not concerning for this PR. We have been seeing that out-of-space failure consistently. |
Hey Parker. Sorry to bug, but how likely do you see this PR making it into the next release? Thanks. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #27864
Reason for this change
When using cdk watch mode, a synth failure causes the CDK CLI to no longer deploy changes. The CDK CLI must be restarted to resume watch mode. The cause of the issue is that CDK CLI never releases the outdir write lock if synthing fails, so subsequent attempts to exec the user's app cannot acquire the outdir writer lock.
Description of changes
I added a try/catch that releases the outdir writer lock & rethrows the error when a synth fails.
Description of how you validated changes
I added a unit test. I also ran the modified cdk cli on a project of my own and simulated the failure of a synth to see whether the issue was resolved, and it is.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license